Class SingleTicketConcreteFactory

java.lang.Object
com.prog3.ipt.Model.TravelDocumentClasses.TravelDocumentFactory
com.prog3.ipt.Model.TravelDocumentClasses.SingleTicketConcreteFactory

public class SingleTicketConcreteFactory extends TravelDocumentFactory
SingleTicketConcreteFactory is a concrete class that extends TravelDocumentFactory abstract class, made to implement Factory Method design pattern
  • Constructor Details

    • SingleTicketConcreteFactory

      public SingleTicketConcreteFactory()
  • Method Details

    • createTravelDocument

      public TravelDocument createTravelDocument(double price, LocalDate issueDate, LocalDate expirationDate, String transactionID, String lineID, String rideID, LocalDate stampDate, LocalDate startDate)
      Returns a SingleTicket object according to the passing parameters
      Specified by:
      createTravelDocument in class TravelDocumentFactory
      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
      Returns:
      A reference to a SingleTicket object