Class TravelDocument

java.lang.Object
com.prog3.ipt.Model.TravelDocumentClasses.TravelDocument
Direct Known Subclasses:
Membership, SingleTicket

public abstract class TravelDocument extends Object
TravelDocument is an abstract class that represents a generic travel document
  • Field Details

    • travelDocumentID

      private String travelDocumentID
    • price

      private double price
    • issueDate

      private LocalDate issueDate
    • expirationDate

      private LocalDate expirationDate
    • transactionID

      private String transactionID
  • Constructor Details

    • TravelDocument

      public TravelDocument(double price, LocalDate issueDate, LocalDate expirationDate, String transactionID)
      TravelDocument constructor
      Parameters:
      price - The price of the travel document
      issueDate - The issue date of the travel document
      expirationDate - The date of expire of the travel document
      transactionID - The unique identifier of the transaction which contains travel documents bought by the citizen
  • Method Details

    • setPrice

      protected void setPrice(double price)
    • setIssueDate

      protected void setIssueDate(LocalDate issueDate)
    • setExpirationDate

      protected void setExpirationDate(LocalDate expirationDate)
    • setTravelDocumentID

      protected void setTravelDocumentID(String travelDocumentID)
    • setTransactionID

      protected void setTransactionID(String transactionID)
    • getTravelDocumentID

      public String getTravelDocumentID()
    • getPrice

      public double getPrice()
    • getIssueDate

      public LocalDate getIssueDate()
    • getExpirationDate

      public LocalDate getExpirationDate()
    • getTransactionID

      public String getTransactionID()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toTravelDocumentFX

      public TravelDocumentFX toTravelDocumentFX()
      Produces a TravelDocumentFX object according to the TravelDocument object calling this method
      Returns:
      A reference to a TravelDocumentFX object
    • updateTravelDocument

      public abstract void updateTravelDocument(double price, LocalDate issueDate, LocalDate expirationDate, String transactionID, String lineID, String rideID, LocalDate stampDate, LocalDate startDate)
      Updates TravelDocument object according to new parameters
      Parameters:
      price - The price of the travel document
      issueDate - The issue date of the travel document
      expirationDate - The date of expire of the travel document
      transactionID - The unique identifier of the transaction which contains travel documents bought by the citizen
      lineID - The unique identifier of the line if the travel document is a single ticket
      rideID - The unique identifier of the ride if the travel document is a single ticket
      stampDate - The stamp date of the travel document, in particular a single ticket
      startDate - The validity start date of the travel document if it is a membership