Class ScreenManager

java.lang.Object
Manager
ScreenManager
All Implemented Interfaces:
Base, BaseManager

public class ScreenManager extends Manager implements BaseManager
A ScreenManager class that extends Manager and implements BaseManager interface

A ScreenManager object used to process all Screen related information

  • Constructor Details

    • ScreenManager

      public ScreenManager()
      Constructor for screen 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
    • getScreenByID

      public ScreenEY getScreenByID(String screenID)
      Method to get screenID
      Parameters:
      screenID - The screenID
      Returns:
      The screen object
    • getScreenNameByID

      public String getScreenNameByID(String screenID)
      Method to get screen name by screenID
      Parameters:
      screenID - The screenID
      Returns:
      The screen name
    • addScreen

      public int addScreen(String cineplexName, String screenName, String screenClass, int numRows, int seatsPerRow)
      Method to add screen
      Parameters:
      cineplexName - The cineplex name
      screenName - The screen name
      screenClass - the screen class
      numRows - The number of rows
      seatsPerRow - The number of seats per row
      Returns:
      numeric value(0:duplicate screen,1: add screen successful,-1: cineplexID not found)
    • listAllScreens

      public ArrayList<String> listAllScreens()
      Method to list all screens
      Returns:
      The list of screen name
    • convIDX2screenID

      public String convIDX2screenID(int idx)
      Method to convert index to screenID
      Parameters:
      idx - An index
      Returns:
      screenID
    • searchScreen

      public ScreenEY searchScreen(String screenName)
      Method to search screen
      Parameters:
      screenName - The screen name
      Returns:
      The screen object
    • getCineplexScreenByName

      public ScreenEY getCineplexScreenByName(CineplexEY cineplex, String screenName)
      Method to get cineplex screen by name
      Parameters:
      cineplex - The cineplex object
      screenName - The screen name
      Returns:
      The ScreenEY object
    • primeScreen

      public void primeScreen() throws IOException
      Method to read screen information from text file
      Throws:
      IOException - If there's read error
    • writeScreen

      public void writeScreen() throws IOException
      Method to write screen information to text file
      Throws:
      IOException - If there's read error