Class ShowManager

All Implemented Interfaces:
Base, BaseManager

public class ShowManager extends Manager implements BaseManager
A ShowManager object

A ShowManager object used to process all show related information

  • Field Details

    • screenMgr

      ScreenManager screenMgr
      contains screen manager object to process screen objects
    • movieMgr

      MovieManager movieMgr
      contains movie manager object to process movie objects
    • cineplexMgr

      CineplexManager cineplexMgr
      contains cineplex manager object to process cineplex objects
  • Constructor Details

    • ShowManager

      public ShowManager()
      Constructor for ShowManager object
  • 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
    • addShow

      public int addShow(String cineplexName, String screenName, String movieName, String showDate, String showTime)
      Method to add show
      Parameters:
      cineplexName - The cineplex name
      screenName - The screen name
      movieName - The movie name
      showDate - The show date
      showTime - The show time
      Returns:
      numeric value (0:successfully add show,1:cineplex is null,2: screen is null,3:movie is null,4:show already exists)
    • updateShow

      public int updateShow(String cineplexName, String screenName, String movieName, String showDate, String showTime, String newShowTime, String newMovieName)
      Method to update show with other show time or movie name
      Parameters:
      cineplexName - The cineplex name
      screenName - The screen name
      movieName - The movie name
      showDate - The show date
      showTime - The show time
      newShowTime - The new show time
      newMovieName - The new movie name
      Returns:
      numeric value (0: successfully updated show,1:all parameter are empty,2:cineplex is empty/null, 3:screen name is empty/null,4:movie name is empty/null,5: matching show is null, 6:new movie name and new showtime is empty,7:new movie is null)
    • removeShow

      public int removeShow(String cineplexName, String screenName, String movieName, String showDate, String showTime)
      Method to remove show
      Parameters:
      cineplexName - The cineplex name
      screenName - The screen name
      movieName - The movie name
      showDate - The show date
      showTime - The show time
      Returns:
      numeric value:0: successfully remove show 1: all parameter empty 2: cineplex name and cineplex object is null 3: screen name is empty screen object is null 4: movie name is empty and movie object is null 5: matching show is null
    • listShows

      public ArrayList<String> listShows(String cineplexName, String screenName, String movieName, String showDate, String showTime)
      Method to list show details
      Parameters:
      cineplexName - The cineplex name
      screenName - The screen name
      movieName - The movie name
      showDate - The show date
      showTime - The show time
      Returns:
      prints screen name, movie name, show date and time, empty seats
    • primeShow

      public void primeShow() throws IOException
      Method to read show details from text file
      Throws:
      IOException - If there's read error
    • writeShow

      public void writeShow() throws IOException
      Method to write show details to text file
      Throws:
      IOException - If there's write error
    • validateList

      public int validateList(String cineplexName, String screenName, String movieName, String showDate, String showTime)
      Method to validate information for show boundary
      Parameters:
      cineplexName - The cineplex name
      screenName - The screen name
      movieName - The movie name
      showDate - The show date
      showTime - The show time
      Returns:
      numeric value (0:credible information,1:no values entered,2:cineplex not found,3:screen not found,4:movie not found)
    • getShowIDFromShowDateIDX

      public String getShowIDFromShowDateIDX(String cineplexID, String movieID, int viewShow)
      Method to get showID from show date
      Parameters:
      cineplexID - The cineplexID
      movieID - The movieID
      viewShow - The user's choice of show
      Returns:
      The show date as the showID
    • getShowDateForMovieAtCineplex

      public ArrayList<String> getShowDateForMovieAtCineplex(String cineplexID, String movieID)
      Method to get show date for a movie at A cineplex
      Parameters:
      cineplexID - The cineplexID
      movieID - The movieID
      Returns:
      The list of show date for a movie at a cineplex
    • getShowIDFromShowTimeIDX

      public ArrayList<String> getShowIDFromShowTimeIDX(String cineplexID, String movieID, String showDate, int viewShow)
      Method to get showID from show time index
      Parameters:
      cineplexID - The cineplexID
      movieID - The movieID
      showDate - The show date
      viewShow - The user choice of show
      Returns:
      The arraylist containing show time,screenID,showID and screenID
    • getShowTimeForMovieAtCineplex

      public ArrayList<String> getShowTimeForMovieAtCineplex(String cineplexID, String movieID, String showDate)
      Method to get show time for a movie at a cineplex
      Parameters:
      cineplexID - The cineplex ID
      movieID - The movie ID
      showDate - The show date
      Returns:
      The list of movie show time and screen names in a cineplex
    • ShowSeatLayout

      public ArrayList<String> ShowSeatLayout(String showID)
      Method to showSeatLayout
      Parameters:
      showID - The showID
      Returns:
      The seat layout for a show
    • setSeatOccupied

      public void setSeatOccupied(String showID, ArrayList<String> seatIDs)
      Method set seat to occupied
      Parameters:
      showID - The showID
      seatIDs - The seatIDs