// Assignment:
// Name:
// StudentID:
// Lecture:
// Description:
import java.io.Serializable;
import java.util.ArrayList;
ArrayList<Movie> reviewList;
public ReviewManager() {
reviewList = new ArrayList<>();
}
/**
* Add a Movie object to the reviewList and return true if such an object
* is added successfully. Otherwise, return false. Two Movies are
* considered duplicated if they have exactly the same movie name and genre.
*
* @param movieName the name of the movie
* @param stars the number of stars the movie recieved
* @param review the movie review
* @param totalCollection the integer total collection earned by the movie
* @param genre the movie's genre
* @param director the movie's director
* @param prodictionCompany production comapny of the movie
* @return true if the operation is successful; false
otherwise
*/
//Adds a movie review to the reviewList
public boolean addReview(String movieName, int stars, String review, String
totalCollection, String genre, String director, String productionCompany) {
if (movieExists(movieName, director) == -1) {
int collection = totalCollection.length();
MovieGenre newGenre = new MovieGenre(genre, productionCompany);
Movie newMovie = new Movie(movieName, stars, review, collection,
director, newGenre);
reviewList.add(newMovie);
return true;
}
return false;
}
}
Powered by TCPDF (www.tcpdf.org)
public class ReviewManager implements Serializable {
// The serialVersionUID is used to verify compatibility of senders and
// receivers. See the document for more details:
//
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Serializable.h
tml
private static final long serialVersionUID = 205L;