Package org.docx4j.fonts.fop.fonts
Class NamedCharacter
java.lang.Object
org.docx4j.fonts.fop.fonts.NamedCharacter
public class NamedCharacter
extends java.lang.Object
Represents an named character with character name (from the Adobe glyph list) and a Unicode
sequence that this character represents.
-
Constructor Summary
Constructors Constructor Description NamedCharacter(java.lang.String charName)Simple constructor.NamedCharacter(java.lang.String charName, java.lang.String unicodeSequence)Main constructor. -
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetName()Returns the character name (as defined by the Adobe glyph list).chargetSingleUnicodeValue()Returns the single Unicode value associated with this named character.java.lang.StringgetUnicodeSequence()Returns the Unicode sequence associated with this character.inthashCode()booleanhasSingleUnicodeValue()Indicates whether a single Unicode value is associated with this character.java.lang.StringtoString()
-
Constructor Details
-
NamedCharacter
public NamedCharacter(java.lang.String charName, java.lang.String unicodeSequence)Main constructor.- Parameters:
charName- the character nameunicodeSequence- the Unicode sequence associated with this character
-
NamedCharacter
public NamedCharacter(java.lang.String charName)Simple constructor.- Parameters:
charName- the character name
-
-
Method Details
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
getName
public java.lang.String getName()Returns the character name (as defined by the Adobe glyph list).- Returns:
- the character name
-
getUnicodeSequence
public java.lang.String getUnicodeSequence()Returns the Unicode sequence associated with this character.- Returns:
- the Unicode sequence (or null if no Unicode sequence is associated)
-
hasSingleUnicodeValue
public boolean hasSingleUnicodeValue()Indicates whether a single Unicode value is associated with this character.- Returns:
- true if exactly one Unicode value is associated with this character, false otherwise
-
getSingleUnicodeValue
public char getSingleUnicodeValue() throws java.lang.IllegalStateExceptionReturns the single Unicode value associated with this named character. CheckhasSingleUnicodeValue()before you call this method because an IllegalStateException is thrown is a Unicode sequence with more than one character is associated with this character.- Returns:
- the single Unicode value (or FFFF ("NOT A CHARACTER") if no Unicode value is available)
- Throws:
java.lang.IllegalStateException- if a Unicode sequence with more than one value is associated with the named character
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-