SageTV Platform
V9.0

sage.media.rss
Class CharacterReference

java.lang.Object
  extended by sage.media.rss.CharacterReference
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
CharacterReferenceEx

 class CharacterReference
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable

Structure to hold a character and it's equivalent entity reference kernel. For the character reference © the character would be '©' and the kernel would be "copy", for example.

Character references are described at Character references Supports the Ordered interface so it's easy to create a list sorted by kernel, to perform binary searches on.


Field Summary
protected  int mCharacter
          The character value as an integer.
protected  java.lang.String mKernel
          This entity reference kernel.
 
Constructor Summary
CharacterReference(java.lang.String kernel, int character)
          Construct a CharacterReference with the character and kernel given.
 
Method Summary
 int compareTo(java.lang.Object that)
          Compare one reference to another.
 int getCharacter()
          Get the character needing translation.
 java.lang.String getKernel()
          Get this CharacterReference's kernel.
(package private)  void setCharacter(int character)
          Set the character.
(package private)  void setKernel(java.lang.String kernel)
          Set this CharacterReference's kernel.
 java.lang.String toString()
          Visualize this character reference as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mCharacter

protected int mCharacter
The character value as an integer.


mKernel

protected java.lang.String mKernel
This entity reference kernel. The text between the ampersand and the semicolon.

Constructor Detail

CharacterReference

public CharacterReference(java.lang.String kernel,
                          int character)
Construct a CharacterReference with the character and kernel given.

Parameters:
kernel - The kernel in the equivalent character entity reference.
character - The character needing encoding.
Method Detail

getKernel

public java.lang.String getKernel()
Get this CharacterReference's kernel.

Returns:
The kernel in the equivalent character entity reference.

setKernel

void setKernel(java.lang.String kernel)
Set this CharacterReference's kernel. This is used to avoid creating a new object to perform a binary search.

Parameters:
kernel - The kernel in the equivalent character entity reference.

getCharacter

public int getCharacter()
Get the character needing translation.

Returns:
The character.

setCharacter

void setCharacter(int character)
Set the character. This is used to avoid creating a new object to perform a binary search.

Parameters:
character - The character needing translation.

toString

public java.lang.String toString()
Visualize this character reference as a string.

Overrides:
toString in class java.lang.Object
Returns:
A string with the character and kernel.

compareTo

public int compareTo(java.lang.Object that)
Compare one reference to another.

Specified by:
compareTo in interface java.lang.Comparable

SageTV Platform
V9.0

SageTV is a trademark or registered trademark of Google, Inc. in the US and other countries.
Copyright 2000-2015 The SageTV Authors. All Rights Reserved.