Class MovieGoerManager

Object
MovieGoerManager

public class MovieGoerManager extends Object
Controller class for handling all logic related to MovieGoer
Version:
1.0
Author:
Jerick, Yeek Sheng
  • 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 a Adult instance and save to database
      Parameters:
      name - is the name of the Movie Goer
      email - is the email address of the Movie Goer
      mobileNum - is the mobile number of the Movie Goer
      username - is the username of Movie Goer in MOBLIMA
      password - 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 a Child instance and save to database
      Parameters:
      name - is the name of the Movie Goer
      email - is the email address of the Movie Goer
      mobileNum - is the mobile number of the Movie Goer
      username - is the username of Movie Goer in MOBLIMA
      password - 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 a SeniorCitizen instance and save to database
      Parameters:
      name - is the name of the Movie Goer
      email - is the email address of the Movie Goer
      mobileNum - is the mobile number of the Movie Goer
      username - is the username of Movie Goer in MOBLIMA
      password - 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 a Student instance and save to database
      Parameters:
      name - is the name of the Movie Goer
      email - is the email address of the Movie Goer
      mobileNum - is the mobile number of the Movie Goer
      username - is the username of Movie Goer in MOBLIMA
      password - is the password of Movie Goer in MOBLIMA
      Returns:
      The created MovieGoer object
    • rankTop5

      public static ArrayList<Movie> rankTop5(String choice, ArrayList<Movie> movies, boolean staff)
      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 the MovieManager.sortMovie(ArrayList, String) and return the sorted movie list, else it will return null.
      Parameters:
      choice - is the parameter to sort the list of movie
      movies - is the ArrayList of Movie to be sorted
      staff - is to check whether the user is a staff.
      Returns:
      The filtered ArrayList of Cinema instances
    • addBookingHistory

      public static void addBookingHistory(BookingHistory history, MovieGoer goer)
      Method to add booking history to MovieGoer object.
      Parameters:
      history - is the BookingHistory to be added
      goer - is the MovieGoer object that the history is added to.