bbc.rd.tvanytime
Class Keyword

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

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

Represents a TV-Anytime Character object. Extends PersonName by changing XML and string representation. Note that strictly a Keyword is an NMTOKEN which must begin with a letter or underscore. Subsequent letters may include letters, digits, underscores, hyphens and periods only. They cannot include whitescape. However I have not added these restrictions to keep backwards-compatibility.

Version:
1.0
Author:
Tristan Ferne, BBC Research & Development, April 2003

Field Summary
static int MAIN
          Possible keyword types, default is Main.
static int OTHER
           
static int SECONDARY
           
 
Constructor Summary
Keyword()
          Constructor.
Keyword(java.lang.String keyword)
          Constructor.
 
Method Summary
 java.lang.Object clone()
          Clones itself.
 java.lang.String getKeyword()
          Get keyword.
 int getType()
          Returns the type for this Keyword object
 void setKeyword(java.lang.String keyword)
          Set keyword.
 void setType(int type)
          Sets the type for this keyword.
 java.lang.String toString()
          toString - returns a String representation of this object
 java.lang.String toString(int indent)
          toString - returns a String representation of this object with the specified number of tab indentations
 java.lang.String toXML()
          Returns a XML representation of this object
 java.lang.String toXML(int indent)
          Returns a XML representation of this 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
Possible keyword types, default is 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
Constructor Detail

Keyword

public Keyword()
Constructor.


Keyword

public Keyword(java.lang.String keyword)
Constructor.

Parameters:
keyword - Keyword.
Method Detail

getKeyword

public java.lang.String getKeyword()
Get keyword.

Returns:
Keyword.

setKeyword

public void setKeyword(java.lang.String keyword)
Set keyword.

Parameters:
keyword - Keyword.

setType

public void setType(int type)
             throws TVAnytimeException
Sets the type for this keyword.

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

getType

public int getType()
Returns the type for this Keyword object

Returns:
the type for this Keyword object

toXML

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

Returns:
the XML representation of this object

toXML

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

Returns:
the XML representation of this object

toString

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

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

toString

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

Returns:
the 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.