Package org.htmlparser.util
Class CharacterReference
- java.lang.Object
-
- org.htmlparser.util.CharacterReference
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,Ordered
public class CharacterReference extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable, Ordered
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 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.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intmCharacterThe character value as an integer.protected java.lang.StringmKernelThis entity reference kernel.
-
Constructor Summary
Constructors Constructor Description CharacterReference(java.lang.String kernel, int character)Construct aCharacterReferencewith the character and kernel given.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(java.lang.Object that)Compare one reference to another.intgetCharacter()Get the character needing translation.java.lang.StringgetKernel()Get this CharacterReference's kernel.java.lang.StringtoString()Visualize this character reference as a string.
-
-
-
Method Detail
-
getKernel
public java.lang.String getKernel()
Get this CharacterReference's kernel.- Returns:
- The kernel in the equivalent character entity reference.
-
getCharacter
public int getCharacter()
Get the character needing translation.- Returns:
- The character.
-
toString
public java.lang.String toString()
Visualize this character reference as a string.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string with the character and kernel.
-
compare
public int compare(java.lang.Object that)
Compare one reference to another.
-
-