Class MovieManager

Object
MovieManager

public class MovieManager extends Object
Controller class for handling all logic related to Movie
Version:
1.0
Author:
Jerick, Yeek Sheng
  • 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 a StandardMovie instance and save to database
      Parameters:
      movieTitle - is the title of movie
      movieAgeRating - is the MovieAgeRating of the movie
      showingStatus - is the MovieShowingStatus of the movie
      movieCast - is all the casts of the movie
      movieDirector - is the director of the movie
      movieSynopsis - is the synopsis of the movie
      movieDuration - 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 a BlockbusterMovie instance and save to database
      Parameters:
      movieTitle - is the title of movie
      movieAgeRating - is the MovieAgeRating of the movie
      showingStatus - is the MovieShowingStatus of the movie
      movieCast - is all the casts of the movie
      movieDirector - is the director of the movie
      movieSynopsis - is the synopsis of the movie
      movieDuration - 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 a ThreeDMovie instance and save to database
      Parameters:
      movieTitle - is the title of movie
      movieAgeRating - is the MovieAgeRating of the movie
      showingStatus - is the MovieShowingStatus of the movie
      movieCast - is all the casts of the movie
      movieDirector - is the director of the movie
      movieSynopsis - is the synopsis of the movie
      movieDuration - is the duration of the movie
      Returns:
      The created Movie object
    • updateMovieTicketSold

      public static void updateMovieTicketSold(Movie movie, int numOfTickets)
      Method to update tickets sold of a movie.
      Parameters:
      movie - is the Movie that the tickets sold need to be updated
      numOfTickets - is the number of tickets just bought and need to be updated to database
    • calculateOverallReviewRating

      public static void calculateOverallReviewRating(Movie movie)
      Method to calculate the overall review rating.
      Parameters:
      movie - is the Movie to query
    • getAllMovieList

      public static ArrayList<Movie> getAllMovieList(Object user)
      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 the MovieShowingStatus is End of Showing.
      Parameters:
      user - is CinemaStaff or MovieGoer
      Returns:
      ArrayList of Movie
    • getMovieList

      public static ArrayList<Movie> getMovieList(String movieTitle)
      Method to get different MovieType of the same movie title.
      Parameters:
      movieTitle - is the movie title to query
      Returns:
      ArrayList of Movie with same title but different MovieType
    • sortMovie

      public static ArrayList<Movie> sortMovie(ArrayList<Movie> movies, String sortBy)
      Method to sort movie list by either ticket sales or overall review rating.
      Parameters:
      movies - is the ArrayList of Movie to be sorted
      sortBy - is the parameter to sort the list
      Returns:
      Sorted ArrayList of Movie
    • movieBookable

      public static boolean movieBookable(Movie movie)
      Method to check whether a movie is bookable.
      Parameters:
      movie - is the Movie to query
      Returns:
      true if bookable
    • getMovieByUUID

      public static Movie getMovieByUUID(String movieUUID)
      Method to obtain a Movie by its UUID
      Parameters:
      movieUUID - is the target movie's UUID
      Returns:
      The target Movie