Class Movie

java.lang.Object
edu.pdx.cs410J.rmi.Movie
All Implemented Interfaces:
Serializable

public class Movie extends Object implements 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
    Constructor
    Description
    Movie(String title, int year)
    Creates a new Movie with the given title and release year.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    addCharacter(String character, long actor)
    Makes note of a character in the movie played by a given actor.
    boolean
    Two Movies are equal if they have the same id
    Returns the ids of the actors that are in this movie
    Returns a map of character names to the actor that played them.
    long
    Returns this Movie's id
    int
     
    Returns the title of this Movie
    int
    Returns the year in which this movie was released
    (package private) void
    setId(long id)
    Package-protected method for setting the id
    void
    Sets the title of this Movie
    void
    setYear(int year)
    Sets the year in which this movie was released
    Returns a brief textual representation of this Movie

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Movie

      Movie(String title, int year)
      Creates a new Movie with the given title and release year. Movies should only be created on the server side.
  • Method Details

    • getId

      public long getId()
      Returns this Movie's id
    • setId

      void setId(long id)
      Package-protected method for setting the id
      Parameters:
      id - The id for this movie
    • getTitle

      public String getTitle()
      Returns the title of this Movie
    • setTitle

      public void setTitle(String title)
      Sets the title of this Movie
    • getYear

      public int getYear()
      Returns the year in which this movie was released
    • setYear

      public void setYear(int year)
      Sets the year in which this movie was released
    • getCharacters

      Returns a map of character names to the actor that played them.
    • getActors

      public Set<Long> getActors()
      Returns the ids of the actors that are in this movie
    • addCharacter

      void addCharacter(String character, long actor)
      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

      public String toString()
      Returns a brief textual representation of this Movie
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Two Movies are equal if they have the same id
      Overrides:
      equals in class Object
    • getNumberOfAwards

      public int getNumberOfAwards()