bbc.rd.tvanytime.programInformation
Class ProgramInformationTable

java.lang.Object
  extended by bbc.rd.tvanytime.programInformation.ProgramInformationTable
All Implemented Interfaces:
MetadataSearch, java.lang.Cloneable

public class ProgramInformationTable
extends java.lang.Object
implements MetadataSearch, java.lang.Cloneable

ProgramInformationTable: Represents a table that contains ProgramInformation objects. Notes: 1) This implementation uses a hashtable and will only store one object per CRID. Adding updated/new objects with the same CRID as a previously existing object will overwrite the previous objects. 2) Because the CRID is used as a key to the hashtable a ProgramInformation object must have a CRID before it can be added.

Version:
1.0 Modified 26/4/04 T.Ferne: Added removeProgramInformation() method. Modified 23/9/04 T.Ferne: Returned to using ContentReference as key to hashtable and fixed remove...() methods.
Author:
Tristan Ferne, BBC Research & Development, April 2002

Constructor Summary
ProgramInformationTable()
          Constructor for objects of type ProgramInformationTable
 
Method Summary
 void addProgramInformation(ProgramInformation programInformation)
          Add a ProgramInformation object.
 java.lang.Object clone()
          Clones itself.
 java.util.Vector getGroupInformation(ContentReference crid)
          Unsupported method - always throws exception.
 int getNumProgramInformations()
          Get the number of ProgramInformation objects.
 java.util.Vector getProgramInformation(ContentReference crid)
          Get program information for the specified CRID.
 ProgramInformation getProgramInformation(int index)
          Get a ProgramInformation object.
 java.util.Vector getProgramLocation(ContentReference crid)
          Unsupported method - always throws exception.
 java.util.Vector getSegmentInformation(ContentReference crid)
          Unsupported method - always throws exception.
 void removeAll()
          Remove all ProgramInformation objects.
 void removeProgramInformation(ContentReference crid)
          Removes a ProgramInformation object from this ProgramInformationTable
 void removeProgramInformation(ProgramInformation programInformation)
          Removes a ProgramInformation object from this ProgramInformationTable
 java.lang.String toString()
          Returns string representation of this table.
 java.lang.String toString(int indent)
          Returns string representation of this table.
 java.lang.String toXML()
          Returns XML representation of this table.
 java.lang.String toXML(int indent)
          Returns XML representation of this table.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProgramInformationTable

public ProgramInformationTable()
Constructor for objects of type ProgramInformationTable

Method Detail

removeAll

public void removeAll()
Remove all ProgramInformation objects.


removeProgramInformation

public void removeProgramInformation(ProgramInformation programInformation)
Removes a ProgramInformation object from this ProgramInformationTable

Parameters:
programInformation - The ProgramInformation object to remove

removeProgramInformation

public void removeProgramInformation(ContentReference crid)
Removes a ProgramInformation object from this ProgramInformationTable

Parameters:
crid - The ContentReference for this ProgramInformation.

addProgramInformation

public void addProgramInformation(ProgramInformation programInformation)
Add a ProgramInformation object. Note that the ProgramInformation object must have a CRID and it will overwrite any existing objects with the same CRID.

Parameters:
The - ProgramInformation object to add to this table.

getProgramInformation

public ProgramInformation getProgramInformation(int index)
Get a ProgramInformation object.

Parameters:
index - The index of the ProgramInformation to access.
Returns:
Specified ProgramInformation object.

getProgramLocation

public java.util.Vector getProgramLocation(ContentReference crid)
                                    throws SearchInterfaceNotSupportedException
Unsupported method - always throws exception.

Specified by:
getProgramLocation in interface MetadataSearch
Parameters:
crid - the CRID of the ProgramLocation object to be searched for.
Returns:
Vector containing ProgramLocation objects. Empty if none found.
Throws:
SearchInterfaceNotSupportedException - If the implementation doesn't support this function.

getProgramInformation

public java.util.Vector getProgramInformation(ContentReference crid)
                                       throws SearchInterfaceNotSupportedException
Get program information for the specified CRID.

Specified by:
getProgramInformation in interface MetadataSearch
Parameters:
crid - the CRID of the ProgramInformation object to be searched for.
Returns:
Vector containing ProgramInformation objects. Empty if none found.
Throws:
SearchInterfaceNotSupportedException - If the implementation doesn't support this function.

getSegmentInformation

public java.util.Vector getSegmentInformation(ContentReference crid)
                                       throws SearchInterfaceNotSupportedException
Unsupported method - always throws exception.

Specified by:
getSegmentInformation in interface MetadataSearch
Parameters:
crid - the CRID of the SegmentInformation object to be searched for.
Returns:
Vector containing SegmentInformation objects. Empty if none found.
Throws:
SearchInterfaceNotSupportedException - If the implementation doesn't support this function.

getGroupInformation

public java.util.Vector getGroupInformation(ContentReference crid)
                                     throws SearchInterfaceNotSupportedException
Unsupported method - always throws exception.

Specified by:
getGroupInformation in interface MetadataSearch
Parameters:
crid - the CRID of the GroupInformation object to be searched for.
Returns:
Vector containing GroupInformation objects. Empty if none found.
Throws:
SearchInterfaceNotSupportedException - If the implementation doesn't support this function.

getNumProgramInformations

public int getNumProgramInformations()
Get the number of ProgramInformation objects.

Returns:
The number of ProgramInformation objects contained in this table.

toXML

public java.lang.String toXML()
Returns XML representation of this table.

Returns:
XML representation of this table.

toXML

public java.lang.String toXML(int indent)
Returns XML representation of this table.

Parameters:
indent - Number of tabs with which to indent the string.
Returns:
XML representation of the table.

toString

public java.lang.String toString()
Returns string representation of this table.

Overrides:
toString in class java.lang.Object
Returns:
String representation of this table.

toString

public java.lang.String toString(int indent)
Returns string representation of this table.

Parameters:
indent - Number of tabs with which to indent the string.
Returns:
string representation of the table.

clone

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

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