Package org.apache.fop.fonts
Class NamedCharacter
- java.lang.Object
-
- org.apache.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getName()
Returns the character name (as defined by the Adobe glyph list).char
getSingleUnicodeValue()
Returns the single Unicode value associated with this named character.java.lang.String
getUnicodeSequence()
Returns the Unicode sequence associated with this character.int
hashCode()
boolean
hasSingleUnicodeValue()
Indicates whether a single Unicode value is associated with this character.java.lang.String
toString()
-
-
-
Constructor Detail
-
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 Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in 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.IllegalStateException
Returns 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:
toString
in classjava.lang.Object
-
-