Class MovieManager

All Implemented Interfaces:
Base, BaseManager

public class MovieManager extends Manager implements BaseManager
A Movie Manager Object

A MovieManager object used process movie object related process

  • Constructor Details

    • MovieManager

      public MovieManager()
      Constructor for movie manager
  • Method Details

    • setManagers

      public void setManagers()
      Method to set the Managers
      Specified by:
      setManagers in interface Base
    • setMasterLists

      public void setMasterLists()
      Method to set Master List
      Specified by:
      setMasterLists in interface BaseManager
    • getMovieByID

      public MovieEY getMovieByID(String movieID)
      Method to get movie object by movieID
      Parameters:
      movieID - The movieID
      Returns:
      The Movie object
    • addMovie

      public Boolean addMovie(String movieName, String language, String movieType, String showStatus, String synopsis, String movieRating, String director, ArrayList<String> cast)
      Method to add movie
      Parameters:
      movieName - The movie name
      language - The movie language
      movieType - The movie type
      showStatus - The showing status of the movie
      synopsis - The synopsis of the movie
      movieRating - The restriction type
      director - The director of the movie
      cast - The cast of the movie
      Returns:
      True if successfully added, False if movie already exists
    • updateMovie

      public Boolean updateMovie(String movieName, String language, String movieType, String movieRating, String showStatus, String synopsis, String director, ArrayList<String> cast)
      Method to update movie attributes
      Parameters:
      movieName - The movie name
      language - The movie language
      movieType - The movie type
      showStatus - The showing status of the movie
      synopsis - The synopsis of the movie
      movieRating - The restriction type
      director - The director of the movie
      cast - The cast of the movie
      Returns:
      True if successfully update, False if search error
    • updateMovieStatus

      public boolean updateMovieStatus(String movieName, String showStatus)
      Method to update movie status
      Parameters:
      movieName - The movie name
      showStatus - The show status (COMINGSOON,PREVIEW,SHOWING,ENDOFSHOWING)
      Returns:
      True if successfully updated the showing status, False if search error
    • searchMovie

      public MovieEY searchMovie(String movieName)
      Method to search for movie object based on name
      Parameters:
      movieName - The movie name
      Returns:
      The movie object
    • getCurrentMoviesLines

      public ArrayList<String> getCurrentMoviesLines()
      Method to get list of movies that have SHOWING/PREVIEW status
      Returns:
      The list of details
    • getCurrentMovies

      public ArrayList<MovieEY> getCurrentMovies()
      Method to get current movies that have SHOWING/PREVIEW status
      Returns:
      The movies
    • getAllMovies

      public ArrayList<String> getAllMovies()
      Method to get all movies
      Returns:
      The list of all movies with movie name and showing status
    • getMovieIDFromCurrentShowingIDX

      public String getMovieIDFromCurrentShowingIDX(Integer idx)
      Method to get movieID from movies that are SHOWING/PREVIEW
      Parameters:
      idx - the index of the movie
      Returns:
      The movieID
    • getMovieByName

      public MovieEY getMovieByName(String movieName)
      Method to get movie object by name
      Parameters:
      movieName - The movie Name
      Returns:
      The movie object
    • ID2Name

      public String ID2Name(String movieID)
      Method to get movie name from movieID
      Parameters:
      movieID - The movieID
      Returns:
      The movie name
    • Name2ID

      public String Name2ID(String movieName)
      Method to get movieID from movie name
      Parameters:
      movieName - The movie name
      Returns:
      The movieID
    • primeMovie

      public void primeMovie() throws IOException
      Method to read movie objects to text file
      Throws:
      IOException - If there's read error
    • writeMovie

      public void writeMovie() throws IOException
      Method to write movie objects to text file
      Throws:
      IOException - If there's write error