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
Modifier and TypeFieldDescriptionprivate String
private PaymentMethodStrategy
private LocalDate
private ArrayList<TravelDocument>
private javafx.collections.ObservableList<TravelDocumentFX>
private double
private String
-
Constructor Summary
ConstructorDescriptionOrder
(String transactionCode, LocalDate purchaseDate, double purchasePrice, String citizenID, PaymentMethodStrategy paymentMethodStrategy, ArrayList<TravelDocument> purchaseList, javafx.collections.ObservableList<TravelDocumentFX> purchaseObservableList) Order constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTravelDocument
(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 . void
addTravelDocumentFX
(TravelDocumentFX travelDocumentFXObject) Gets the equivalent TravelDocument object of FX TravelDocument object and adds reference to it into an ArrayList. boolean
javafx.collections.ObservableList<TravelDocumentFX>
double
int
hashCode()
void
removeTravelDocument
(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 . void
removeTravelDocumentFX
(TravelDocumentFX travelDocumentFXObject) Gets the equivalent TravelDocument object of FX TravelDocument object and removes reference to it into an ArrayList. (package private) void
setCitizenID
(String citizenID) (package private) void
setPaymentMethodStrategy
(PaymentMethodStrategy paymentMethodStrategy) (package private) void
setPurchaseDate
(LocalDate purchaseDate) (package private) void
setPurchaseList
(ArrayList<TravelDocument> purchaseList) (package private) void
setPurchaseObservableList
(javafx.collections.ObservableList<TravelDocumentFX> purchaseObservableList) (package private) void
setPurchasePrice
(double purchasePrice) (package private) void
setTransactionCode
(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
-