FileDocCategorySizeDatePackage
MediaContent.javaAPI DocExample2341Sun Nov 03 21:24:42 GMT 2002com.mediamania.content

MediaContent

public abstract class MediaContent extends Object

Fields Summary
private static SimpleDateFormat
yearFmt
private String
title
private Studio
studio
private Date
releaseDate
private String
rating
private String
ratingReasons
private Set
mediaItems
Constructors Summary
protected MediaContent()

 // MediaItem
    
     
     
public MediaContent(String title, Studio studio, Date releaseDate, String rating, String reasons)

        this.title = title;
        this.studio = studio;
        this.releaseDate = releaseDate;
        this.rating = rating;
        ratingReasons = reasons;
        mediaItems = new HashSet();
    
Methods Summary
public voidaddMediaItem(com.mediamania.store.MediaItem item)

        mediaItems.add(item);
    
public java.lang.StringformatReleaseDate()

        return yearFmt.format(releaseDate);
    
public java.lang.StringgetDescription()

        StringBuffer buffer = new StringBuffer();
        buffer.append(title);
        buffer.append(", ");
        buffer.append(studio.getName());
        buffer.append(", release date: ");
        buffer.append(formatReleaseDate());
        buffer.append(", rating: ");
        buffer.append(rating);
        buffer.append(", reasons for rating: ");
        buffer.append(ratingReasons);
        return buffer.toString();
    
public java.util.SetgetMediaItems()

        return Collections.unmodifiableSet(mediaItems);
    
public java.lang.StringgetRating()

        return rating;
    
public java.lang.StringgetRatingReasons()

        return ratingReasons;
    
public java.util.DategetReleaseDate()

        return releaseDate;
    
public StudiogetStudio()

        return studio;
    
public java.lang.StringgetTitle()

        return title;
    
public static java.util.DateparseReleaseDate(java.lang.String val)

        Date date = null;
        try {
            date = yearFmt.parse(val);
        } catch (java.text.ParseException exc) { }
        return date;
    
public abstract booleanvalidRating(java.lang.String rating)