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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Method to calculate the overall review rating.static Movie
createBlockbusterMovie
(String movieTitle, MovieAgeRating movieAgeRating, MovieShowingStatus showingStatus, ArrayList<String> movieCast, String movieDirector, String movieSynopsis, double movieDuration) Method to create aBlockbusterMovie
instance and save to databasestatic Movie
createStandardMovie
(String movieTitle, MovieAgeRating movieAgeRating, MovieShowingStatus showingStatus, ArrayList<String> movieCast, String movieDirector, String movieSynopsis, double movieDuration) Method to create aStandardMovie
instance and save to databasestatic Movie
createThreeDMovie
(String movieTitle, MovieAgeRating movieAgeRating, MovieShowingStatus showingStatus, ArrayList<String> movieCast, String movieDirector, String movieSynopsis, double movieDuration) Method to create aThreeDMovie
instance and save to databasegetAllMovieList
(Object user) Method to get the list of all movies.static Movie
getMovieByUUID
(String movieUUID) Method to obtain aMovie
by its UUIDgetMovieList
(String movieTitle) Method to get differentMovieType
of the same movie title.static boolean
movieBookable
(Movie movie) Method to check whether a movie is bookable.Method to sort movie list by either ticket sales or overall review rating.static void
updateMovieTicketSold
(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 aStandardMovie
instance and save to database- Parameters:
movieTitle
- is the title of moviemovieAgeRating
- is theMovieAgeRating
of the movieshowingStatus
- is theMovieShowingStatus
of 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
Movie
object
-
createBlockbusterMovie
public static Movie createBlockbusterMovie(String movieTitle, MovieAgeRating movieAgeRating, MovieShowingStatus showingStatus, ArrayList<String> movieCast, String movieDirector, String movieSynopsis, double movieDuration) Method to create aBlockbusterMovie
instance and save to database- Parameters:
movieTitle
- is the title of moviemovieAgeRating
- is theMovieAgeRating
of the movieshowingStatus
- is theMovieShowingStatus
of 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
Movie
object
-
createThreeDMovie
public static Movie createThreeDMovie(String movieTitle, MovieAgeRating movieAgeRating, MovieShowingStatus showingStatus, ArrayList<String> movieCast, String movieDirector, String movieSynopsis, double movieDuration) Method to create aThreeDMovie
instance and save to database- Parameters:
movieTitle
- is the title of moviemovieAgeRating
- is theMovieAgeRating
of the movieshowingStatus
- is theMovieShowingStatus
of 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
Movie
object
-
updateMovieTicketSold
Method to update tickets sold of a movie.- Parameters:
movie
- is theMovie
that 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 theMovie
to 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 theMovieShowingStatus
is End of Showing.- Parameters:
user
- isCinemaStaff
orMovieGoer
- Returns:
- ArrayList of
Movie
-
getMovieList
Method to get differentMovieType
of 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 theMovie
to query- Returns:
true
if bookable
-
getMovieByUUID
Method to obtain aMovie
by its UUID- Parameters:
movieUUID
- is the target movie's UUID- Returns:
- The target
Movie
-