bbc.rd.tvanytime.contentReferencing
Class ContentReferencingTable

java.lang.Object
  extended by bbc.rd.tvanytime.contentReferencing.ContentReferencingTable
All Implemented Interfaces:
LocationResolution, java.io.Serializable, java.lang.Cloneable

public class ContentReferencingTable
extends java.lang.Object
implements java.lang.Cloneable, LocationResolution, java.io.Serializable

ContentReferencingTable: Represents a table that contains ContentReferencing objects.

Version:
1.1
Author:
Tim Sargeant, BBC Research & Development, February 2003, Tristan Ferne, BBC Research & Development, August 2003
See Also:
Serialized Form

Constructor Summary
ContentReferencingTable()
          Constructor for objects of type ContentReferencingTable.
ContentReferencingTable(float version)
          Constructor for objects of type ContentReferencingTable with required version attribute.
 
Method Summary
 void addResult(Result result)
          Add a Result object.
 java.lang.Object clone()
          Clones itself.
 int getNumResults()
          Get the number of Result objects.
 Result getResult(int index)
          Get a Result object.
 java.util.Vector getSchedule(java.util.Date startTime, java.util.Date endTime)
          Returns vector of CRIDs for all events that start at a time between the start time and the end time.
 java.util.Vector getSchedule(java.util.Date startTime, java.util.Date endTime, java.lang.String serviceID)
          Unsupported method - always throws exception.
 float getVersion()
          Get version
 void removeAll()
          Remove all objects from the ContentReferencing table.
 void removeResult(int index)
          Removes a Result object from this ContentReferencingTable
 void removeResult(Result result)
          Removes a Result object from this ContentReferencingTable
 Result resolveCRID(ContentReference crid)
          Returns Result object for this CRID.
 java.util.Vector resolveLeafCRID(ContentReference crid)
          Unsupported method - always throws exception.
 java.util.Vector resolveLeafCRID(ContentReference crid, java.lang.String serviceID)
          Unsupported method - always throws exception.
 void setVersion(float version)
          Set version
 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

ContentReferencingTable

public ContentReferencingTable()
Constructor for objects of type ContentReferencingTable.


ContentReferencingTable

public ContentReferencingTable(float version)
Constructor for objects of type ContentReferencingTable with required version attribute.

Parameters:
Version - number.
Method Detail

addResult

public void addResult(Result result)
Add a Result object.

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

getResult

public Result getResult(int index)
Get a Result object.

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

removeResult

public void removeResult(int index)
Removes a Result object from this ContentReferencingTable

Parameters:
index - The index to the Result object

removeResult

public void removeResult(Result result)
Removes a Result object from this ContentReferencingTable

Parameters:
result - The Result object to remove

removeAll

public void removeAll()
Remove all objects from the ContentReferencing table.


getNumResults

public int getNumResults()
Get the number of Result objects.

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

setVersion

public void setVersion(float version)
Set version

Parameters:
version - the table version number

getVersion

public float getVersion()
Get version

Returns:
The version number for this table

resolveLeafCRID

public java.util.Vector resolveLeafCRID(ContentReference crid)
                                 throws SearchInterfaceNotSupportedException
Unsupported method - always throws exception. Use resolveCRID() instead.

Specified by:
resolveLeafCRID in interface LocationResolution
Parameters:
crid - the CRID to search for.
Returns:
Vector of BroadcastURLs for this CRID.
Throws:
SearchInterfaceNotSupportedException - If the implementation doesn't support this function.

resolveLeafCRID

public java.util.Vector resolveLeafCRID(ContentReference crid,
                                        java.lang.String serviceID)
                                 throws SearchInterfaceNotSupportedException
Unsupported method - always throws exception. Use resolveCRID() instead, then if you've got locators (having looked up the DVB triplet for your serviceID in the ServiceInformation table) check the ProgramURL's dvb triplet for a match.

Specified by:
resolveLeafCRID in interface LocationResolution
Parameters:
crid - the CRID to search for.
serviceID - The serviceID of the service we are interested in.
Returns:
Vector containing BroadcastURLs for this CRID.
Throws:
SearchInterfaceNotSupportedException - If the implementation doesn't support this function.

resolveCRID

public Result resolveCRID(ContentReference crid)
Returns Result object for this CRID.

Parameters:
crid - CRID to search for.
Returns:
Result for this CRID.

getSchedule

public java.util.Vector getSchedule(java.util.Date startTime,
                                    java.util.Date endTime)
Returns vector of CRIDs for all events that start at a time between the start time and the end time.
This implementation returns CRIDS of programmes which are showing between start and end times. (eg. if startTime = 22:04, the crid of a news programme which started at 22:00 will be returned. Similarly, the crid of programmes showing at the endTime will be returned.)

The search is carried out by examining the start time and duration found in the dvb locator, so will fail if DVB locator isn't present.

Specified by:
getSchedule in interface LocationResolution
Parameters:
startTime - Start time of schedule.
endTime - End time of schedule.
Returns:
Vector of all ContentReferences in this time period.

getSchedule

public java.util.Vector getSchedule(java.util.Date startTime,
                                    java.util.Date endTime,
                                    java.lang.String serviceID)
                             throws SearchInterfaceNotSupportedException
Unsupported method - always throws exception. This method is not supported on ContentReferencingTable. serviceID is not known in the table - to perform an equivalent search, you should use getSchedule( ) on this (ContentReferencing) table, then resolve each returned CRID to retrieve the locator(s). Now, using the ServiceInformation table, translate between serviceID and dvb triplet, and check the DVB triplet part of each locator for a match.

Specified by:
getSchedule in interface LocationResolution
Parameters:
startTime - Start time of schedule.
endTime - End time of schedule.
serviceID - The serviceID of the service we are interested in.
Returns:
Vector of all ContentReferences on this service in this time period.
Throws:
SearchInterfaceNotSupportedException - If the implementation doesn't support this function.

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.