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
-
Method Summary
Modifier and TypeMethodDescription(package private) void
addCharacter
(String character, long actor) Makes note of a character in the movie played by a given actor.boolean
TwoMovie
s 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.long
getId()
Returns thisMovie
's idint
getTitle()
Returns the title of thisMovie
int
getYear()
Returns the year in which this movie was released(package private) void
setId
(long id) Package-protected method for setting the idvoid
Sets the title of thisMovie
void
setYear
(int year) Sets the year in which this movie was releasedtoString()
Returns a brief textual representation of thisMovie
-
Constructor Details
-
Movie
Creates a newMovie
with 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
TwoMovie
s are equal if they have the same id -
getNumberOfAwards
-