Class MovieManager
java.lang.Object
Manager
MovieManager
- All Implemented Interfaces:
Base,BaseManager
A Movie Manager Object
A MovieManager object used
process movie object related process
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMovie(String movieName, String language, String movieType, String showStatus, String synopsis, String movieRating, String director, ArrayList<String> cast) Method to add movieMethod to get all moviesMethod to get current movies that have SHOWING/PREVIEW statusMethod to get list of movies that have SHOWING/PREVIEW statusgetMovieByID(String movieID) Method to get movie object by movieIDgetMovieByName(String movieName) Method to get movie object by nameMethod to get movieID from movies that are SHOWING/PREVIEWMethod to get movie name from movieIDMethod to get movieID from movie namevoidMethod to read movie objects to text filesearchMovie(String movieName) Method to search for movie object based on namevoidMethod to set the ManagersvoidMethod to set Master ListupdateMovie(String movieName, String language, String movieType, String movieRating, String showStatus, String synopsis, String director, ArrayList<String> cast) Method to update movie attributesbooleanupdateMovieStatus(String movieName, String showStatus) Method to update movie statusvoidMethod to write movie objects 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
-
Constructor Details
-
MovieManager
public MovieManager()Constructor for movie manager
-
-
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
-
getMovieByID
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 namelanguage- The movie languagemovieType- The movie typeshowStatus- The showing status of the moviesynopsis- The synopsis of the moviemovieRating- The restriction typedirector- The director of the moviecast- 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 namelanguage- The movie languagemovieType- The movie typeshowStatus- The showing status of the moviesynopsis- The synopsis of the moviemovieRating- The restriction typedirector- The director of the moviecast- The cast of the movie- Returns:
- True if successfully update, False if search error
-
updateMovieStatus
Method to update movie status- Parameters:
movieName- The movie nameshowStatus- The show status (COMINGSOON,PREVIEW,SHOWING,ENDOFSHOWING)- Returns:
- True if successfully updated the showing status, False if search error
-
searchMovie
Method to search for movie object based on name- Parameters:
movieName- The movie name- Returns:
- The movie object
-
getCurrentMoviesLines
Method to get list of movies that have SHOWING/PREVIEW status- Returns:
- The list of details
-
getCurrentMovies
Method to get current movies that have SHOWING/PREVIEW status- Returns:
- The movies
-
getAllMovies
Method to get all movies- Returns:
- The list of all movies with movie name and showing status
-
getMovieIDFromCurrentShowingIDX
Method to get movieID from movies that are SHOWING/PREVIEW- Parameters:
idx- the index of the movie- Returns:
- The movieID
-
getMovieByName
Method to get movie object by name- Parameters:
movieName- The movie Name- Returns:
- The movie object
-
ID2Name
Method to get movie name from movieID- Parameters:
movieID- The movieID- Returns:
- The movie name
-
Name2ID
Method to get movieID from movie name- Parameters:
movieName- The movie name- Returns:
- The movieID
-
primeMovie
Method to read movie objects to text file- Throws:
IOException- If there's read error
-
writeMovie
Method to write movie objects to text file- Throws:
IOException- If there's write error
-