java.io.Serializable
, java.lang.Cloneable
, Ordered
public class CharacterReference extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable, Ordered
Character references are described at http://www.w3.org/TR/REC-html40/charset.html#entities Supports the Ordered interface so it's easy to create a list sorted by kernel, to perform binary searches on.
Modifier and Type | Field | Description |
---|---|---|
protected int |
mCharacter |
The character value as an integer.
|
protected java.lang.String |
mKernel |
This entity reference kernel.
|
Constructor | Description |
---|---|
CharacterReference(java.lang.String kernel,
int character) |
Construct a
CharacterReference with the character and kernel given. |
Modifier and Type | Method | Description |
---|---|---|
int |
compare(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.
|
java.lang.String |
toString() |
Visualize this character reference as a string.
|
protected int mCharacter
protected java.lang.String mKernel
public CharacterReference(java.lang.String kernel, int character)
CharacterReference
with the character and kernel given.kernel
- The kernel in the equivalent character entity reference.character
- The character needing encoding.public java.lang.String getKernel()
public int getCharacter()
public java.lang.String toString()
toString
in class java.lang.Object
public int compare(java.lang.Object that)
HTML Parser is an open source library released under LGPL.