com.gcapmedia.dab.epg.binary
Class Token
java.lang.Object
com.gcapmedia.dab.epg.binary.Token
- All Implemented Interfaces:
- Encodable
public class Token
- extends java.lang.Object
- implements Encodable
Defines an entry in the token table as per clause 4.9.1 of the binary
encoding specification.
Frequently recurring strings in the EPG character data ("tokens") can
be encoded using a token table. A token holds a tag used to represent
an equivalent string. Whenever a decoder finds the tag in a stream it
shall replace the tag with its equivalent string.
A token can only occur within the two top-level elements (epg and
serviceInformation) and all children of the parent element.
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Token
public Token(TokenTag tag,
StringType value)
- Create a new attribute
- Parameters:
tag
- Attribute tagdata
- Attribute value
getTag
public TokenTag getTag()
- Returns:
- Returns the attribute tag
getValue
public Encodable getValue()
- Returns:
- Returns the attribute value
getBytes
public byte[] getBytes()
- Specified by:
getBytes
in interface Encodable
- Returns:
- Returns the data as bytes
- See Also:
Encodable.getBytes()
getLength
public int getLength()
- Specified by:
getLength
in interface Encodable
- Returns:
- Returns the length of this data
- See Also:
Encodable.getLength()
fromBytes
public static Token fromBytes(byte[] bytes)
- Parse an object from its byte array representation
- Parameters:
parent
- Tag parentbytes
- Byte array representation
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
- See Also:
Object.equals(java.lang.Object)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- See Also:
Object.toString()
Copyright © 2007. All Rights Reserved.