Package src.controller
Class MovieManager
Object
MovieManager
Controller class for handling all logic related to
Movie- Version:
- 1.0
- Author:
- Jerick, Yeek Sheng
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidMethod to calculate the overall review rating.static MoviecreateBlockbusterMovie(String movieTitle, MovieAgeRating movieAgeRating, MovieShowingStatus showingStatus, ArrayList<String> movieCast, String movieDirector, String movieSynopsis, double movieDuration) Method to create aBlockbusterMovieinstance and save to databasestatic MoviecreateStandardMovie(String movieTitle, MovieAgeRating movieAgeRating, MovieShowingStatus showingStatus, ArrayList<String> movieCast, String movieDirector, String movieSynopsis, double movieDuration) Method to create aStandardMovieinstance and save to databasestatic MoviecreateThreeDMovie(String movieTitle, MovieAgeRating movieAgeRating, MovieShowingStatus showingStatus, ArrayList<String> movieCast, String movieDirector, String movieSynopsis, double movieDuration) Method to create aThreeDMovieinstance and save to databasegetAllMovieList(Object user) Method to get the list of all movies.static MoviegetMovieByUUID(String movieUUID) Method to obtain aMovieby its UUIDgetMovieList(String movieTitle) Method to get differentMovieTypeof the same movie title.static booleanmovieBookable(Movie movie) Method to check whether a movie is bookable.Method to sort movie list by either ticket sales or overall review rating.static voidupdateMovieTicketSold(Movie movie, int numOfTickets) Method to update tickets sold of a movie.
-
Constructor Details
-
MovieManager
public MovieManager()Constructor
-
-
Method Details
-
createStandardMovie
public static Movie createStandardMovie(String movieTitle, MovieAgeRating movieAgeRating, MovieShowingStatus showingStatus, ArrayList<String> movieCast, String movieDirector, String movieSynopsis, double movieDuration) Method to create aStandardMovieinstance and save to database- Parameters:
movieTitle- is the title of moviemovieAgeRating- is theMovieAgeRatingof the movieshowingStatus- is theMovieShowingStatusof the moviemovieCast- is all the casts of the moviemovieDirector- is the director of the moviemovieSynopsis- is the synopsis of the moviemovieDuration- is the duration of the movie- Returns:
- The created
Movieobject
-
createBlockbusterMovie
public static Movie createBlockbusterMovie(String movieTitle, MovieAgeRating movieAgeRating, MovieShowingStatus showingStatus, ArrayList<String> movieCast, String movieDirector, String movieSynopsis, double movieDuration) Method to create aBlockbusterMovieinstance and save to database- Parameters:
movieTitle- is the title of moviemovieAgeRating- is theMovieAgeRatingof the movieshowingStatus- is theMovieShowingStatusof the moviemovieCast- is all the casts of the moviemovieDirector- is the director of the moviemovieSynopsis- is the synopsis of the moviemovieDuration- is the duration of the movie- Returns:
- The created
Movieobject
-
createThreeDMovie
public static Movie createThreeDMovie(String movieTitle, MovieAgeRating movieAgeRating, MovieShowingStatus showingStatus, ArrayList<String> movieCast, String movieDirector, String movieSynopsis, double movieDuration) Method to create aThreeDMovieinstance and save to database- Parameters:
movieTitle- is the title of moviemovieAgeRating- is theMovieAgeRatingof the movieshowingStatus- is theMovieShowingStatusof the moviemovieCast- is all the casts of the moviemovieDirector- is the director of the moviemovieSynopsis- is the synopsis of the moviemovieDuration- is the duration of the movie- Returns:
- The created
Movieobject
-
updateMovieTicketSold
Method to update tickets sold of a movie.- Parameters:
movie- is theMoviethat the tickets sold need to be updatednumOfTickets- is the number of tickets just bought and need to be updated to database
-
calculateOverallReviewRating
Method to calculate the overall review rating.- Parameters:
movie- is theMovieto query
-
getAllMovieList
Method to get the list of all movies. If the user is a staff, he/she will get all the movies. If the user is a Movie Goer, he/she will get all the movies exclude movies that theMovieShowingStatusis End of Showing.- Parameters:
user- isCinemaStafforMovieGoer- Returns:
- ArrayList of
Movie
-
getMovieList
Method to get differentMovieTypeof the same movie title. -
sortMovie
Method to sort movie list by either ticket sales or overall review rating. -
movieBookable
Method to check whether a movie is bookable.- Parameters:
movie- is theMovieto query- Returns:
trueif bookable
-
getMovieByUUID
Method to obtain aMovieby its UUID- Parameters:
movieUUID- is the target movie's UUID- Returns:
- The target
Movie
-