bbc.rd.tvanytime.util
Class TVAnytimeGenreToolbox

java.lang.Object
  extended by bbc.rd.tvanytime.util.GenreToolbox
      extended by bbc.rd.tvanytime.util.TVAnytimeGenreToolbox

public class TVAnytimeGenreToolbox
extends GenreToolbox

TVAnytimeGenreToolBox: Implementation of GenreToolbox specifically for TV-Anytime Genres.

Version:
1.0 Modified 13/2/04 T.Ferne: Reversed order of elements obtained from getSubGenre() methods. Modified 29/4/04 T.Ferne: Updated so compatible with ETSI TS 102 822-3-1 V1.1.1 (2003-10)
Author:
Chris Akanbi, BBC Research & Development, April 2002

Method Summary
static java.util.Vector findGenre(java.lang.String searchName)
          findGenre - returns the named hierarchy of any genres containing the specifed genre name
static java.lang.String getNameHierarchy(java.lang.String numberHierarchy)
          getNameHeirarchy - converts a numbered heirarchy to its corresponding name heirarchy
static java.lang.String getNumberHierarchy(java.lang.String nameHierarchy)
          getNumberHierarchy - converts a named hierarchy to its corresponding number hierarchy
static int getNumLevels(java.lang.String hierarchy)
          getNumLevels - returns the number of levels used in the Genre hierarchy passed
static java.lang.String getParent(java.lang.String hierarchy)
          getParent - returns the Genre hierarchy of the Genre one level up the Genre hierarchy from the the Genre hierarchy passed
static java.util.Vector getSubGenres(java.lang.String genreParent)
          getSubGenres - from a genre heading(in numbered hierarchy form) get any sub-genres
static java.util.Vector getTopLevelSubGenres(java.lang.String genreParent)
          getTopLevelSubGenres - from a genre heading(in numbered hierarchy form) get the immediate child sub-genres only.
static boolean isValid(java.lang.String hierarchy)
          isValid - verifies whether a genre hierarchy is included in the current genre scheme
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNameHierarchy

public static java.lang.String getNameHierarchy(java.lang.String numberHierarchy)
getNameHeirarchy - converts a numbered heirarchy to its corresponding name heirarchy

Parameters:
numberHeirarchy - the numbered heirarchy String to be converted
Returns:
the name heirarchy String

getNumberHierarchy

public static java.lang.String getNumberHierarchy(java.lang.String nameHierarchy)
getNumberHierarchy - converts a named hierarchy to its corresponding number hierarchy

Parameters:
nameHierarchy - the named hierarchy String to be converted
Returns:
the name hierarchy String

isValid

public static boolean isValid(java.lang.String hierarchy)
isValid - verifies whether a genre hierarchy is included in the current genre scheme

Parameters:
genreHierarchy - the hierarchy (number or name) String to be verified. If a name hierarchy is passed it must have correct case
Returns:
whether the hierarchy is valid as a boolean object

getSubGenres

public static java.util.Vector getSubGenres(java.lang.String genreParent)
getSubGenres - from a genre heading(in numbered hierarchy form) get any sub-genres

Parameters:
genreParent - the genre heading (number hierarchy String) from which sub genres are to be found
Returns:
a Vector of the numbered hierarchy Strings of the subgenre objects

getTopLevelSubGenres

public static java.util.Vector getTopLevelSubGenres(java.lang.String genreParent)
getTopLevelSubGenres - from a genre heading(in numbered hierarchy form) get the immediate child sub-genres only.

Parameters:
genreParent - the genre heading (number hierarchy) from which sub genres are to be found. If null then returns all top-level genres only.
Returns:
a Vector of the numbered hierarchy Strings of the subgenre objects

findGenre

public static java.util.Vector findGenre(java.lang.String searchName)
findGenre - returns the named hierarchy of any genres containing the specifed genre name

Parameters:
genreName - the genre name to be searched for
Returns:
a Vector of the Genre name heirarchy strings containing the Genre name

getParent

public static java.lang.String getParent(java.lang.String hierarchy)
getParent - returns the Genre hierarchy of the Genre one level up the Genre hierarchy from the the Genre hierarchy passed

Parameters:
hierarchy - the hierarchy String of the Genre whose parent is desired (can be numbered or named)
Returns:
the numbered Genre hierarchy String of the parent of the Genre passed

getNumLevels

public static int getNumLevels(java.lang.String hierarchy)
getNumLevels - returns the number of levels used in the Genre hierarchy passed

Parameters:
hierarchy - the numbered or named hierarchy of the Genre object whose number of levels is desired
Returns:
the number of levels in the passed Genre hierarchy