Class ShowManager
java.lang.Object
Manager
ShowManager
- All Implemented Interfaces:
Base,BaseManager
A ShowManager object
A ShowManager object used to process
all show related information
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) CineplexManagercontains cineplex manager object to process cineplex objects(package private) MovieManagercontains movie manager object to process movie objects(package private) ScreenManagercontains screen manager object to process screen objects -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintMethod to add showgetShowDateForMovieAtCineplex(String cineplexID, String movieID) Method to get show date for a movie at A cineplexgetShowIDFromShowDateIDX(String cineplexID, String movieID, int viewShow) Method to get showID from show dategetShowIDFromShowTimeIDX(String cineplexID, String movieID, String showDate, int viewShow) Method to get showID from show time indexgetShowTimeForMovieAtCineplex(String cineplexID, String movieID, String showDate) Method to get show time for a movie at a cineplexlistShows(String cineplexName, String screenName, String movieName, String showDate, String showTime) Method to list show detailsvoidMethod to read show details from text fileintremoveShow(String cineplexName, String screenName, String movieName, String showDate, String showTime) Method to remove showvoidMethod to set the ManagersvoidMethod to set Master ListvoidsetSeatOccupied(String showID, ArrayList<String> seatIDs) Method set seat to occupiedShowSeatLayout(String showID) Method to showSeatLayoutintupdateShow(String cineplexName, String screenName, String movieName, String showDate, String showTime, String newShowTime, String newMovieName) Method to update show with other show time or movie nameintvalidateList(String cineplexName, String screenName, String movieName, String showDate, String showTime) Method to validate information for show boundaryvoidMethod to write show details to text fileMethods inherited from class Manager
getCentralManager, setCentralManagerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Base
getCentralManager, setCentralManager
-
Field Details
-
screenMgr
ScreenManager screenMgrcontains screen manager object to process screen objects -
movieMgr
MovieManager movieMgrcontains movie manager object to process movie objects -
cineplexMgr
CineplexManager cineplexMgrcontains 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:
setManagersin interfaceBase
-
setMasterLists
public void setMasterLists()Method to set Master List- Specified by:
setMasterListsin interfaceBaseManager
-
addShow
public int addShow(String cineplexName, String screenName, String movieName, String showDate, String showTime) Method to add show- Parameters:
cineplexName- The cineplex namescreenName- The screen namemovieName- The movie nameshowDate- The show dateshowTime- 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 namescreenName- The screen namemovieName- The movie nameshowDate- The show dateshowTime- The show timenewShowTime- The new show timenewMovieName- 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 namescreenName- The screen namemovieName- The movie nameshowDate- The show dateshowTime- 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 namescreenName- The screen namemovieName- The movie nameshowDate- The show dateshowTime- The show time- Returns:
- prints screen name, movie name, show date and time, empty seats
-
primeShow
Method to read show details from text file- Throws:
IOException- If there's read error
-
writeShow
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 namescreenName- The screen namemovieName- The movie nameshowDate- The show dateshowTime- 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
Method to get showID from show date- Parameters:
cineplexID- The cineplexIDmovieID- The movieIDviewShow- The user's choice of show- Returns:
- The show date as the showID
-
getShowDateForMovieAtCineplex
Method to get show date for a movie at A cineplex- Parameters:
cineplexID- The cineplexIDmovieID- 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 cineplexIDmovieID- The movieIDshowDate- The show dateviewShow- 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 IDmovieID- The movie IDshowDate- The show date- Returns:
- The list of movie show time and screen names in a cineplex
-
ShowSeatLayout
Method to showSeatLayout- Parameters:
showID- The showID- Returns:
- The seat layout for a show
-
setSeatOccupied
Method set seat to occupied- Parameters:
showID- The showIDseatIDs- The seatIDs
-