Package org.htmlparser.util
Class CharacterReference
java.lang.Object
org.htmlparser.util.CharacterReference
- All Implemented Interfaces:
Serializable
,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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
The character value as an integer.protected String
This entity reference kernel. -
Constructor Summary
ConstructorsConstructorDescriptionCharacterReference
(String kernel, int character) Construct aCharacterReference
with the character and kernel given. -
Method Summary
-
Field Details
-
mCharacter
protected int mCharacterThe character value as an integer. -
mKernel
This entity reference kernel. The text between the ampersand and the semicolon.
-
-
Constructor Details
-
CharacterReference
Construct aCharacterReference
with the character and kernel given.- Parameters:
kernel
- The kernel in the equivalent character entity reference.character
- The character needing encoding.
-
-
Method Details
-
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
Visualize this character reference as a string. -
compare
Compare one reference to another.
-