Class SingleTicket

java.lang.Object
com.prog3.ipt.Model.TravelDocumentClasses.TravelDocument
com.prog3.ipt.Model.TravelDocumentClasses.SingleTicket

public class SingleTicket extends TravelDocument
SingleTicket is a class that extends TravelDocument abstract class
  • Field Details

  • Constructor Details

    • SingleTicket

      public SingleTicket(double price, LocalDate issueDate, LocalDate expirationDate, String transactionID, String lineID, String rideID, LocalDate stampDate)
      SingleTicket 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
      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
  • Method Details

    • setRideID

      private void setRideID(String rideID)
    • setLineID

      private void setLineID(String lineID)
    • setStampDate

      private void setStampDate(LocalDate stampDate)
    • getRideID

      public String getRideID()
    • getLineID

      public String getLineID()
    • getStampDate

      public LocalDate getStampDate()
    • equals

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

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

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

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

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