bbc.rd.tvanytime
Class InstanceMetadataId

java.lang.Object
  extended by bbc.rd.tvanytime.InstanceMetadataId
All Implemented Interfaces:
java.io.Serializable

public class InstanceMetadataId
extends java.lang.Object
implements java.io.Serializable

Represents an InstanceMetadataId. This is an optional identifier that shall identify a particular location related to a CRID (i.e. a programme). This identifier shall be unique within the CRID domain

Version:
1.0
Author:
Tristan Ferne, BBC Research & Development, August 2004
See Also:
Serialized Form

Constructor Summary
InstanceMetadataId()
          Constructor.
InstanceMetadataId(java.lang.String imi)
          Constructor.
 
Method Summary
 java.lang.Object clone()
          Clones itself.
 boolean equals(InstanceMetadataId testIMI)
          Are these IMIs equal?
 java.lang.String getInstanceMetadataId()
          Get the IMI.
 void setInstanceMetadataId(java.lang.String imi)
          Set the InstanceMetadataId.
 java.lang.String toString()
          Returns string representation of this object.
 java.lang.String toString(int indent)
          Returns string representation of this object.
 java.lang.String toXML()
          Returns XML representation of this object.
 java.lang.String toXML(int indent)
          Returns XML representation of this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InstanceMetadataId

public InstanceMetadataId()
Constructor.


InstanceMetadataId

public InstanceMetadataId(java.lang.String imi)
                   throws TVAnytimeException
Constructor.

Parameters:
imi - Instance metadata ID. Should be a URI in the form "imi:"
Throws:
TVAnytimeException - thrown when IMI starts with invalid pattern
Method Detail

equals

public boolean equals(InstanceMetadataId testIMI)
Are these IMIs equal?

Parameters:
testIMI - The InstanceMetadataID to be compared.
Returns:
true if InstanceMetadataID is equal to this InstanceMetadataID; false otherwise

setInstanceMetadataId

public void setInstanceMetadataId(java.lang.String imi)
                           throws TVAnytimeException
Set the InstanceMetadataId. Tests for validity of "imi:" portion of IMI, and throws a TVAnytimeException if invalid.

Parameters:
imi - The IMI as a String
Throws:
TVAnytimeException

getInstanceMetadataId

public java.lang.String getInstanceMetadataId()
Get the IMI.

Returns:
The String representation of the IMI (e.g. "imi:bbc.co.uk/21837") or null if crid is undefined

toXML

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

Returns:
XML representation of this object.

toXML

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

Parameters:
indent - number of tabs to put before the string.
Returns:
XML representation of this object.

toString

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

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

toString

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

Parameters:
indent - number of tabs to put before the string.
Returns:
string representation of this object.

clone

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

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