Package edu.pdx.cs410J.rmi
Class Movie
java.lang.Object
edu.pdx.cs410J.rmi.Movie
- All Implemented Interfaces:
Serializable
This class represents a remote
Movie object. It is
Serializable because instances of Movie are
sent from the server to client. Because it does not implement the
Remote interface, the client JVM receives copies
of the Movie object. That is, changes to a
Movie made on by the client are not reflected in the
server.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddCharacter(String character, long actor) Makes note of a character in the movie played by a given actor.booleanTwoMovies are equal if they have the same idReturns the ids of the actors that are in this movieReturns a map of character names to the actor that played them.longgetId()Returns thisMovie's idintgetTitle()Returns the title of thisMovieintgetYear()Returns the year in which this movie was released(package private) voidsetId(long id) Package-protected method for setting the idvoidSets the title of thisMovievoidsetYear(int year) Sets the year in which this movie was releasedtoString()Returns a brief textual representation of thisMovie
-
Constructor Details
-
Movie
Creates a newMoviewith the given title and release year. Movies should only be created on the server side.
-
-
Method Details
-
getId
Returns thisMovie's id -
setId
Package-protected method for setting the id- Parameters:
id- The id for this movie
-
getTitle
Returns the title of thisMovie -
setTitle
Sets the title of thisMovie -
getYear
Returns the year in which this movie was released -
setYear
Sets the year in which this movie was released -
getCharacters
Returns a map of character names to the actor that played them. -
getActors
Returns the ids of the actors that are in this movie -
addCharacter
Makes note of a character in the movie played by a given actor. This behavior is intended to be server-side only.- Throws:
IllegalArgumentException- There is a character by that name that is played by a different actor.
-
toString
Returns a brief textual representation of thisMovie -
equals
TwoMovies are equal if they have the same id -
getNumberOfAwards
-