net.sf.xtvdclient.xtvd.datatypes
Class TvRatings

java.lang.Object
  extended by net.sf.xtvdclient.xtvd.datatypes.TvRatings
All Implemented Interfaces:
java.lang.Comparable

public class TvRatings
extends java.lang.Object
implements java.lang.Comparable

A ordinal-based typesafe enum class that represents the pre-defined values for tms:tvRatings as defined in the XTVD schema.

Since:
ddclient 1.2

Copyright 2004, Tribune Media Services

$Id: TvRatings.java,v 1.5 2004/03/26 15:55:38 rakesh Exp $


Field Summary
static TvRatings TV14
          The typesafe representation of the TV-14 tvRating.
static TvRatings TVG
          The typesafe representation of the TV-G tvRating.
static TvRatings TVMA
          The typesafe representation of the TV-MA tvRating.
static TvRatings TVPG
          The typesafe representation of the TV-PG tvRating.
static TvRatings TVY
          The typesafe representation of the TV-Y tvRating.
static TvRatings TVY7
          The typesafe representation of the TV-Y7 tvRating.
 
Method Summary
 int compareTo(java.lang.Object object)
          Implementation of the Comparable interface.
 boolean equals(java.lang.Object object)
          Indicates whether some other object is "equal to" this one.
static TvRatings getTvRating(java.lang.String rating)
          Return the appropriate TvRatings based upon the string specified.
 int hashCode()
          Returns a hash code value for this class.
 java.lang.String toString()
          Over-ridden to return the value of rating.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TVY

public static final TvRatings TVY
The typesafe representation of the TV-Y tvRating.


TVY7

public static final TvRatings TVY7
The typesafe representation of the TV-Y7 tvRating.


TVG

public static final TvRatings TVG
The typesafe representation of the TV-G tvRating.


TVPG

public static final TvRatings TVPG
The typesafe representation of the TV-PG tvRating.


TV14

public static final TvRatings TV14
The typesafe representation of the TV-14 tvRating.


TVMA

public static final TvRatings TVMA
The typesafe representation of the TV-MA tvRating.

Method Detail

getTvRating

public static TvRatings getTvRating(java.lang.String rating)
Return the appropriate TvRatings based upon the string specified. If the appropriate tv rating does not exist return null.

Parameters:
rating - The rating value that is to be used to fetch the corresponding TvRatings.
Returns:
The appropriate instance if a corresponding instance is found, null otherwise.

toString

public java.lang.String toString()
Over-ridden to return the value of rating.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this class instance.

compareTo

public int compareTo(java.lang.Object object)
Implementation of the Comparable interface. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - The object with which this class is to be compared. No class type checking is done.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

equals

public boolean equals(java.lang.Object object)
Indicates whether some other object is "equal to" this one. Returns true if the specified object is of the same class type, and has the same ordinal value.

Overrides:
equals in class java.lang.Object
Parameters:
object - The reference object with which to compare.
Returns:
Return true if the match succeeds.

hashCode

public int hashCode()
Returns a hash code value for this class. Return the value of ordinal.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code value for the object.