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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addBookingHistory
(BookingHistory history, MovieGoer goer) Method to add booking history toMovieGoer
object.static MovieGoer
Method to create aAdult
instance and save to databasestatic MovieGoer
Method to create aChild
instance and save to databasestatic MovieGoer
createGoerSeniorCitizen
(String name, String email, String mobileNum, String username, String password) Method to create aSeniorCitizen
instance and save to databasestatic MovieGoer
Method to create aStudent
instance 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 aAdult
instance 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
MovieGoer
object
-
createGoerChild
public static MovieGoer createGoerChild(String name, String email, String mobileNum, String username, String password) Method to create aChild
instance 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
MovieGoer
object
-
createGoerSeniorCitizen
public static MovieGoer createGoerSeniorCitizen(String name, String email, String mobileNum, String username, String password) Method to create aSeniorCitizen
instance 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
MovieGoer
object
-
createGoerStudent
public static MovieGoer createGoerStudent(String name, String email, String mobileNum, String username, String password) Method to create aStudent
instance 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
MovieGoer
object
-
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 toMovieGoer
object.- Parameters:
history
- is theBookingHistory
to be addedgoer
- is theMovieGoer
object that the history is added to.
-