Package src.controller
Class MovieGoerManager
Object
MovieGoerManager
Controller class for handling all logic related to
MovieGoer- Version:
- 1.0
- Author:
- Jerick, Yeek Sheng
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBookingHistory(BookingHistory history, MovieGoer goer) Method to add booking history toMovieGoerobject.static MovieGoerMethod to create aAdultinstance and save to databasestatic MovieGoerMethod to create aChildinstance and save to databasestatic MovieGoercreateGoerSeniorCitizen(String name, String email, String mobileNum, String username, String password) Method to create aSeniorCitizeninstance and save to databasestatic MovieGoerMethod to create aStudentinstance and save to databaseMethod to sort all movies according to overall rating or tickets sales.
-
Constructor Details
-
MovieGoerManager
public MovieGoerManager()Constructor
-
-
Method Details
-
createGoerAdult
public static MovieGoer createGoerAdult(String name, String email, String mobileNum, String username, String password) Method to create aAdultinstance and save to database- Parameters:
name- is the name of the Movie Goeremail- is the email address of the Movie GoermobileNum- is the mobile number of the Movie Goerusername- is the username of Movie Goer in MOBLIMApassword- is the password of Movie Goer in MOBLIMA- Returns:
- The created
MovieGoerobject
-
createGoerChild
public static MovieGoer createGoerChild(String name, String email, String mobileNum, String username, String password) Method to create aChildinstance and save to database- Parameters:
name- is the name of the Movie Goeremail- is the email address of the Movie GoermobileNum- is the mobile number of the Movie Goerusername- is the username of Movie Goer in MOBLIMApassword- is the password of Movie Goer in MOBLIMA- Returns:
- The created
MovieGoerobject
-
createGoerSeniorCitizen
public static MovieGoer createGoerSeniorCitizen(String name, String email, String mobileNum, String username, String password) Method to create aSeniorCitizeninstance and save to database- Parameters:
name- is the name of the Movie Goeremail- is the email address of the Movie GoermobileNum- is the mobile number of the Movie Goerusername- is the username of Movie Goer in MOBLIMApassword- is the password of Movie Goer in MOBLIMA- Returns:
- The created
MovieGoerobject
-
createGoerStudent
public static MovieGoer createGoerStudent(String name, String email, String mobileNum, String username, String password) Method to create aStudentinstance and save to database- Parameters:
name- is the name of the Movie Goeremail- is the email address of the Movie GoermobileNum- is the mobile number of the Movie Goerusername- is the username of Movie Goer in MOBLIMApassword- is the password of Movie Goer in MOBLIMA- Returns:
- The created
MovieGoerobject
-
rankTop5
Method to sort all movies according to overall rating or tickets sales. This method will check the permission of the user to access the sorted Top 5 data of movie. If the user has the permission, then it will call theMovieManager.sortMovie(ArrayList, String)and return the sorted movie list, else it will return null. -
addBookingHistory
Method to add booking history toMovieGoerobject.- Parameters:
history- is theBookingHistoryto be addedgoer- is theMovieGoerobject that the history is added to.
-