Package src.controller
Class SeatManager
Object
SeatManager
Controller class for handling all logic related to
Seat- Version:
- 1.0
- Author:
- Lee Juin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanbookSeat(String seatID, MovieSchedule movieSchedule, ArrayList<Seat> seatingPlan, Cinema cinema, boolean assign) Method to book/unbook seatstatic SeatMethod to create aCoupleSeatand save to databasestatic SeatMethod to create aStandardSeatand save to databasestatic StringgetNextSeatID(String seatID, Cinema cinema) Method to get the next seat's ID for couple seatstatic SeatgetSeatBySeatID(String seatID, ArrayList<Seat> seatingPlan, Cinema cinema) Method to obtainSeatinstance by the front-end displayed seat IDstatic SeatgetSeatByUUID(String seatUUID) Method to retrieveSeatinstance by its UUIDstatic voidprintPlatinumCinemaFloorMap(ArrayList<Seat> seatingPlan) Method to print the floor map of a platinum cinemastatic voidprintStandardCinemaFloorMap(ArrayList<Seat> seatingPlan) Method to print the floor map of a standard cinema (non-platinum)static intseatIDConverter(String seatID, Cinema cinema) Method to convert the front-end displayed seat ID (i.e.static booleanvalidateBooking(Seat seat, boolean booking) Helper function to verify that the act of booking/unbooking is legitimate
-
Constructor Details
-
SeatManager
public SeatManager()Constructor
-
-
Method Details
-
createCoupleSeat
Method to create aCoupleSeatand save to database- Returns:
- The created
CoupleSeatinstace.
-
createStandardSeat
Method to create aStandardSeatand save to database- Returns:
- The created
StandardSeatinstace.
-
printStandardCinemaFloorMap
Method to print the floor map of a standard cinema (non-platinum)- Parameters:
seatingPlan- is the seating plan to be printed
-
printPlatinumCinemaFloorMap
Method to print the floor map of a platinum cinema- Parameters:
seatingPlan- is the seating plan to be printed
-
seatIDConverter
Method to convert the front-end displayed seat ID (i.e. A1, B3, etc.) into back-end seatID for processing- Parameters:
seatID- is the front-end displayed seat IDcinema- is the cinema chosen by the MovieGoer- Returns:
- The back-end convereted seatID
-
validateBooking
Helper function to verify that the act of booking/unbooking is legitimate- Parameters:
seat- is theSeatinstance to be booked/unbookedbooking- is the booking statustrueto represent book andfalseto represent unbook- Returns:
trueif the act is legitimate,falseotherwise
-
bookSeat
public static boolean bookSeat(String seatID, MovieSchedule movieSchedule, ArrayList<Seat> seatingPlan, Cinema cinema, boolean assign) Method to book/unbook seat- Parameters:
seatID- is the front-end displayed seat IDmovieSchedule- is theMovieScheduleinstance of the movieseatingPlan- is the seating plan selected by the usercinema- is theCinemainstance the MovieGoer chosenassign-trueif booking, otherwisefalse- Returns:
trueif booking/unbooking is successful,falseotherwise
-
getSeatBySeatID
Method to obtainSeatinstance by the front-end displayed seat ID -
getSeatByUUID
Method to retrieveSeatinstance by its UUID- Parameters:
seatUUID- The target seat's UUID- Returns:
- The target seat
-
getNextSeatID
Method to get the next seat's ID for couple seat- Parameters:
seatID- is the current seat's IDcinema- is the target cinema- Returns:
- The next seat's ID
-