Package moblima.control.handlers
Class MovieHandler
java.lang.Object
moblima.control.handlers.MovieHandler
- Direct Known Subclasses:
ReviewHandler
The type Movie handler.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe Movies.protected intThe Selected movie idx. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintaddMovie(int id, String title, String synopsis, String director, List<String> castList, int runtime, LocalDate releaseDate, boolean isBlockbuster, Movie.ShowStatus showStatus, Movie.ContentRating contentRating, int overallRating) Add movie int.getMovie(int movieIdx) Gets movie.intgetMovieIdx(int movieId) Gets movie idx.Gets movies.getMovies(Movie.ShowStatus showStatus) Gets movies.Gets selected movie.voidPrint movies.voidprintMovies(List<Movie> movies) Print movies.booleanremoveMovie(int movieIdx) Remove movie boolean.protected booleanSave movies boolean.voidsetSelectedMovieIdx(int movieIdx) Sets selected movie idx.booleanupdateMovie(String title, String synopsis, String director, List<String> castList, int runtime, LocalDate releaseDate, boolean isBlockbuster, Movie.ShowStatus showStatus, Movie.ContentRating contentRating, double overallRating) Update movie boolean.booleanupdateMovieRating(int movieId, double overallRating) Update movie rating boolean.
-
Field Details
-
movies
The Movies. -
selectedMovieIdx
protected int selectedMovieIdxThe Selected movie idx.
-
-
Constructor Details
-
MovieHandler
public MovieHandler()Instantiates a new Movie handler.
-
-
Method Details
-
getSelectedMovie
Gets selected movie.- Returns:
- the selected movie
-
setSelectedMovieIdx
public void setSelectedMovieIdx(int movieIdx) Sets selected movie idx.- Parameters:
movieIdx- the movie idx
-
getMovie
Gets movie.- Parameters:
movieIdx- the movie idx- Returns:
- the movie
-
getMovieIdx
public int getMovieIdx(int movieId) Gets movie idx.- Parameters:
movieId- the movie id- Returns:
- the movie idx
-
updateMovieRating
public boolean updateMovieRating(int movieId, double overallRating) Update movie rating boolean.- Parameters:
movieId- the movie idoverallRating- the overall rating- Returns:
- the boolean
-
getMovies
Gets movies.- Returns:
- the movies
-
getMovies
Gets movies.- Parameters:
showStatus- the show status- Returns:
- the movies
-
addMovie
public int addMovie(int id, String title, String synopsis, String director, List<String> castList, int runtime, LocalDate releaseDate, boolean isBlockbuster, Movie.ShowStatus showStatus, Movie.ContentRating contentRating, int overallRating) Add movie int.- Parameters:
id- the idtitle- the titlesynopsis- the synopsisdirector- the directorcastList- the cast listruntime- the runtimereleaseDate- the release dateisBlockbuster- the is blockbustershowStatus- the show statuscontentRating- the content ratingoverallRating- the overall rating- Returns:
- the int
-
updateMovie
public boolean updateMovie(String title, String synopsis, String director, List<String> castList, int runtime, LocalDate releaseDate, boolean isBlockbuster, Movie.ShowStatus showStatus, Movie.ContentRating contentRating, double overallRating) Update movie boolean.- Parameters:
title- the titlesynopsis- the synopsisdirector- the directorcastList- the cast listruntime- the runtimereleaseDate- the release dateisBlockbuster- the is blockbustershowStatus- the show statuscontentRating- the content ratingoverallRating- the overall rating- Returns:
- the boolean
-
removeMovie
public boolean removeMovie(int movieIdx) Remove movie boolean.- Parameters:
movieIdx- the movie idx- Returns:
- the boolean
-
printMovies
public void printMovies()Print movies. -
printMovies
Print movies.- Parameters:
movies- the movies
-
saveMovies
protected boolean saveMovies()Save movies boolean.- Returns:
- the boolean
-