java.lang.Object
com.prog3.ipt.Model.CitizenClasses.Order
Order is a class that represents a purchase commit by a citizen due to buy tickets and season tickets
offered for sale by the system
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate PaymentMethodStrategyprivate LocalDateprivate ArrayList<TravelDocument>private javafx.collections.ObservableList<TravelDocumentFX>private doubleprivate String -
Constructor Summary
ConstructorsConstructorDescriptionOrder(String transactionCode, LocalDate purchaseDate, double purchasePrice, String citizenID, PaymentMethodStrategy paymentMethodStrategy, ArrayList<TravelDocument> purchaseList, javafx.collections.ObservableList<TravelDocumentFX> purchaseObservableList) Order constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTravelDocument(TravelDocument travelDocumentObject) Adds a reference to a TravelDocument object into an ArrayListobject, then gets the equivalent FX TravelDocument object of TravelDocument object and adds reference to it into an ObservableList . voidaddTravelDocumentFX(TravelDocumentFX travelDocumentFXObject) Gets the equivalent TravelDocument object of FX TravelDocument object and adds reference to it into an ArrayList. booleanjavafx.collections.ObservableList<TravelDocumentFX>doubleinthashCode()voidremoveTravelDocument(TravelDocument travelDocumentObject) Removes a reference to a TravelDocument object into an ArrayListobject, then gets the equivalent FX TravelDocument object of TravelDocument object and removes reference to it into an ObservableList . voidremoveTravelDocumentFX(TravelDocumentFX travelDocumentFXObject) Gets the equivalent TravelDocument object of FX TravelDocument object and removes reference to it into an ArrayList. (package private) voidsetCitizenID(String citizenID) (package private) voidsetPaymentMethodStrategy(PaymentMethodStrategy paymentMethodStrategy) (package private) voidsetPurchaseDate(LocalDate purchaseDate) (package private) voidsetPurchaseList(ArrayList<TravelDocument> purchaseList) (package private) voidsetPurchaseObservableList(javafx.collections.ObservableList<TravelDocumentFX> purchaseObservableList) (package private) voidsetPurchasePrice(double purchasePrice) (package private) voidsetTransactionCode(String transactionCode) toString()
-
Field Details
-
transactionCode
-
purchaseDate
-
purchasePrice
private double purchasePrice -
citizenID
-
paymentMethodStrategy
-
purchaseList
-
purchaseObservableList
-
-
Constructor Details
-
Order
public Order(String transactionCode, LocalDate purchaseDate, double purchasePrice, String citizenID, PaymentMethodStrategy paymentMethodStrategy, ArrayList<TravelDocument> purchaseList, javafx.collections.ObservableList<TravelDocumentFX> purchaseObservableList) Order constructor- Parameters:
transactionCode- The unique identifier of the transaction commit by a citizenpurchaseDate- Date on which the transaction took placepurchasePrice- Total cost of the transactioncitizenID- Citizen who commit transactionpaymentMethodStrategy- Method used to pay for the transactionpurchaseList- List of purchases made by the transactionpurchaseObservableList- FX Object which represents list of purchases made by the transaction
-
-
Method Details
-
setTransactionCode
-
setPurchaseDate
-
setPurchasePrice
void setPurchasePrice(double purchasePrice) -
setCitizenID
-
setPaymentMethodStrategy
-
setPurchaseList
-
setPurchaseObservableList
void setPurchaseObservableList(javafx.collections.ObservableList<TravelDocumentFX> purchaseObservableList) -
getTransactionCode
-
getPurchaseDate
-
getPurchasePrice
public double getPurchasePrice() -
getCitizenID
-
getPaymentMethodStrategy
-
getPurchaseList
-
getPurchaseObservableList
-
addTravelDocument
Adds a reference to a TravelDocument object into an ArrayListobject, then gets the equivalent FX TravelDocument object of TravelDocument object and adds reference to it into an ObservableList . In the end adds the cost of the TravelDocument object in question to the total amount of the transaction. - Parameters:
travelDocumentObject- Travel document bought by transaction
-
removeTravelDocument
Removes a reference to a TravelDocument object into an ArrayListobject, then gets the equivalent FX TravelDocument object of TravelDocument object and removes reference to it into an ObservableList . In the end removes the cost of the TravelDocument object in question to the total amount of the transaction. - Parameters:
travelDocumentObject- Travel document to remove from transaction
-
addTravelDocumentFX
Gets the equivalent TravelDocument object of FX TravelDocument object and adds reference to it into an ArrayList. Adds a reference to a FX TravelDocument object into an ObservableList object. In the end adds the cost of the FX TravelDocument object in question to the total amount of the transaction. - Parameters:
travelDocumentFXObject- FX object of Travel document bought by transaction
-
removeTravelDocumentFX
Gets the equivalent TravelDocument object of FX TravelDocument object and removes reference to it into an ArrayList. Removes a reference to a FX TravelDocument object into an ObservableList object. In the end removes the cost of the FX TravelDocument object in question to the total amount of the transaction. - Parameters:
travelDocumentFXObject- FX object of Travel document to remove from transaction
-
equals
-
hashCode
public int hashCode() -
toString
-