bbc.rd.tvanytime
Class Genre

java.lang.Object
  extended by bbc.rd.tvanytime.Genre
All Implemented Interfaces:
java.lang.Cloneable

public class Genre
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
static int GENRE_CS_NUM
           
static int MAIN
           
static int OTHER
           
static int SECONDARY
           
 
Constructor Summary
Genre()
          Constructor for Genre class
Genre(java.lang.String href)
          Constructor for Genre class
 
Method Summary
 void addMPEG7Name(java.lang.String MPEG7Name)
          addMPEG7Name - adds a MPEG7Name to this Genre object
 java.lang.Object clone()
          Clones itself.
 int getGenreValue(int genreLevel)
          getGenreValue - returns the value of the Genre at the specified level
 java.lang.String getHref()
          getHref - returns the href variable for this Genre object as a String
 java.lang.String getMPEG7Name(int index)
          getMPEG7Name - returns the MPEG7Name String at the specified index
 java.lang.String getNumberedHierarchy()
          getNumberedHierarchy - returns the String representation of the Genre dot-separated number
 int getNumMPEG7Names()
          getNumMPEG7Names - returns the number of MPEG7Name Strings in this Genre object
 int getType()
          getType - returns the Genre type for this Genre object
 void setHref(java.lang.String href)
          setHref - sets the href variable for this Genre.
 void setLevel(int genreLevel, int genreValue)
          setLevel - sets the specified genre name level to the value passed as a parameter
 void setNumberedHierarchy(java.lang.String numberedHierarchy)
          setNumberedHierarchy - sets the numbered hierarchy of this Genre and also updates the href String and CS number and clears MPEG7Names.
 void setType(int type)
          setType - sets the genre type for this Genre
 java.lang.String toString()
          toString - returns a String representation of this Genre object
 java.lang.String toString(int indent)
          toString - returns a String representation of this Genre object with the specified number of tab indentations
 java.lang.String toXML()
          Returns a XML representation of this Genre object
 java.lang.String toXML(int indent)
          Returns a XML representation of this Genre object with the specified number of tab indentations
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAIN

public static final int MAIN
See Also:
Constant Field Values

SECONDARY

public static final int SECONDARY
See Also:
Constant Field Values

OTHER

public static final int OTHER
See Also:
Constant Field Values

GENRE_CS_NUM

public static final int GENRE_CS_NUM
See Also:
Constant Field Values
Constructor Detail

Genre

public Genre()
Constructor for Genre class


Genre

public Genre(java.lang.String href)
      throws TVAnytimeException
Constructor for Genre class

Parameters:
href - a String representing the href attribute for this Genre (including the numbered Genre hierarchy
Throws:
TVAnytimeException - if the string passed is of the wrong format
Method Detail

setNumberedHierarchy

public void setNumberedHierarchy(java.lang.String numberedHierarchy)
                          throws TVAnytimeException
setNumberedHierarchy - sets the numbered hierarchy of this Genre and also updates the href String and CS number and clears MPEG7Names.

Parameters:
numberedHierarchy - String representation of dot-separated genre number
Throws:
TVAnytimeException - if the hierarchy string is of the wrong format

getNumberedHierarchy

public java.lang.String getNumberedHierarchy()
getNumberedHierarchy - returns the String representation of the Genre dot-separated number

Returns:
String representation of the Genre dot-separated number

setLevel

public void setLevel(int genreLevel,
                     int genreValue)
              throws TVAnytimeException
setLevel - sets the specified genre name level to the value passed as a parameter

Parameters:
genreLevel - the genre level to be set
genreValue - the value the genre level is to be set to
Throws:
TVAnytimeException - if there is a format error

getGenreValue

public int getGenreValue(int genreLevel)
getGenreValue - returns the value of the Genre at the specified level

Parameters:
genreLevel - the level of the genre value required
Returns:
genreValue the value of the genre at the required level

setType

public void setType(int type)
             throws TVAnytimeException
setType - sets the genre type for this Genre

Parameters:
type - the genre type required for this Genre
Throws:
TVAnytimeException - if the type is invalid

getType

public int getType()
getType - returns the Genre type for this Genre object

Returns:
the Genre type for this Genre object

setHref

public void setHref(java.lang.String href)
             throws TVAnytimeException
setHref - sets the href variable for this Genre. Note: must have prefix of "urn:tva:metadata:cs:xxxCS:2002:" to be valid. Also sets CS number.

Parameters:
href - the href required for this Genre
Throws:
TVAnytimeException - if the href string has the wrong format

getHref

public java.lang.String getHref()
getHref - returns the href variable for this Genre object as a String

Returns:
the href variable for this Genre object

toXML

public java.lang.String toXML()
Returns a XML representation of this Genre object

Returns:
the XML representation of this Genre object

toXML

public java.lang.String toXML(int indent)
Returns a XML representation of this Genre object with the specified number of tab indentations

Returns:
the XML representation of this Genre object

toString

public java.lang.String toString()
toString - returns a String representation of this Genre object

Overrides:
toString in class java.lang.Object
Returns:
the String representation of this Genre object

toString

public java.lang.String toString(int indent)
toString - returns a String representation of this Genre object with the specified number of tab indentations

Returns:
the String representation of this String object

addMPEG7Name

public void addMPEG7Name(java.lang.String MPEG7Name)
addMPEG7Name - adds a MPEG7Name to this Genre object

Parameters:
MPEG7Name - the MPEG7Name String to be added

getMPEG7Name

public java.lang.String getMPEG7Name(int index)
getMPEG7Name - returns the MPEG7Name String at the specified index

Parameters:
index - the index of the desired MPEG7Name String
Returns:
the MPEG7Name String at the specified index

getNumMPEG7Names

public int getNumMPEG7Names()
getNumMPEG7Names - returns the number of MPEG7Name Strings in this Genre object

Returns:
the number of MPEG7Name Strings in this Genre object

clone

public java.lang.Object clone()
Clones itself.

Overrides:
clone in class java.lang.Object
Returns:
A copy of itself.