Package moblima.control.handlers
Class ReviewHandler
java.lang.Object
moblima.control.handlers.MovieHandler
moblima.control.handlers.ReviewHandler
The type Review handler.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe Reviews.protected int
The Selected review idx.Fields inherited from class moblima.control.handlers.MovieHandler
movies, selectedMovieIdx
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Add review int.checkIfAlreadyReviewed
(String authorId, int movieId) Check if already reviewed string.double
computeMovieRatings
(int movieId) Compute movie ratings double.getMovieReviews
(int movieId) Gets movie reviews.getReview
(int reviewIdx) Gets review.Gets review.int
getReviewIdx
(String reviewId) Gets review idx.Gets reviews.Gets selected review.getUserReviews
(String authorId) Gets user reviews.printMovieDetails
(int movieIdx, boolean showTruncated) Print movie details.boolean
removeReview
(String reviewId) Remove review boolean.protected boolean
Save reviews boolean.void
setSelectedReviewIdx
(int reviewIdx) Sets selected review idx.boolean
updateReview
(int rating, String reviewContent) Update review boolean.Methods inherited from class moblima.control.handlers.MovieHandler
addMovie, getMovie, getMovieIdx, getMovies, getMovies, getSelectedMovie, printMovies, printMovies, removeMovie, saveMovies, setSelectedMovieIdx, updateMovie, updateMovieRating
-
Field Details
-
reviews
The Reviews. -
selectedReviewIdx
protected int selectedReviewIdxThe Selected review idx.
-
-
Constructor Details
-
ReviewHandler
public ReviewHandler()Instantiates a new Review handler.
-
-
Method Details
-
getSelectedReview
Gets selected review.- Returns:
- the selected review
-
setSelectedReviewIdx
public void setSelectedReviewIdx(int reviewIdx) Sets selected review idx.- Parameters:
reviewIdx
- the review idx
-
getReview
Gets review.- Parameters:
reviewIdx
- the review idx- Returns:
- the review
-
getReview
Gets review.- Parameters:
reviewId
- the review id- Returns:
- the review
-
getReviewIdx
Gets review idx.- Parameters:
reviewId
- the review id- Returns:
- the review idx
-
getReviews
Gets reviews.- Returns:
- the reviews
-
updateReview
Update review boolean.- Parameters:
rating
- the ratingreviewContent
- the review content- Returns:
- the boolean
-
removeReview
Remove review boolean.- Parameters:
reviewId
- the review id- Returns:
- the boolean
-
getMovieReviews
Gets movie reviews.- Parameters:
movieId
- the movie id- Returns:
- the movie reviews
-
getUserReviews
Gets user reviews.- Parameters:
authorId
- the author id- Returns:
- the user reviews
-
addReview
Add review int.- Parameters:
movieId
- the movie idreview
- the reviewrating
- the ratingauthorName
- the author nameauthorId
- the author id- Returns:
- the int
-
computeMovieRatings
public double computeMovieRatings(int movieId) Compute movie ratings double.- Parameters:
movieId
- the movie id- Returns:
- the double
-
checkIfAlreadyReviewed
Check if already reviewed string.- Parameters:
authorId
- the author idmovieId
- the movie id- Returns:
- the string
-
printMovieDetails
Print movie details.- Parameters:
movieIdx
- the movie idxshowTruncated
- the show truncated- Returns:
- the string
-
saveReviews
protected boolean saveReviews()Save reviews boolean.- Returns:
- the boolean
-