Moviepublic class Movie extends MediaContent
Fields Summary |
---|
private static String[] | allRatings | private String | genres | private Set | cast | private MediaPerson | director | private int | runningTime | private String | webSite |
Constructors Summary |
---|
private Movie()
| public Movie(String title, Studio studio, Date releaseDate, String rating, String reasons, String genres, int runningTime, MediaPerson director)
super(title, studio, releaseDate, rating, reasons);
this.runningTime = runningTime;
this.genres = genres;
cast = new HashSet();
this.director = director;
if (director != null) director.addMoviesDirected(this);
|
Methods Summary |
---|
public void | addRole(Role r)
cast.add(r);
| public java.util.Set | getCast()
return Collections.unmodifiableSet(cast);
| public java.lang.String | getDescription()
StringBuffer buffer = new StringBuffer();
buffer.append("Movie: ");
buffer.append(super.getDescription());
buffer.append(", genre: ");
buffer.append(genres);
buffer.append(" running time: ");
buffer.append(runningTime);
return buffer.toString();
| public MediaPerson | getDirector()
return director;
| public void | removeRole(Role r)
cast.remove(r);
| public boolean | validRating(java.lang.String rating)
for (int i = 0; i < allRatings.length; ++i) {
if (rating.equals(allRatings[i])) return true;
}
return false;
|
|