org.apache.fop.fonts

## Class NamedCharacter

- java.lang.Object
- - org.apache.fop.fonts.NamedCharacter

-     public class NamedCharacter
      extends 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 and Description
    `NamedCharacter(String charName)` Simple constructor.
    `NamedCharacter(String charName, String unicodeSequence)` Main constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `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.
    `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.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### NamedCharacter

          public NamedCharacter(String charName,
                                String unicodeSequence)

      Main constructor.
      Parameters:
        `charName` - the character name
        `unicodeSequence` - the Unicode sequence associated with this character

    - #### NamedCharacter

          public NamedCharacter(String charName)

      Simple constructor.
      Parameters:
        `charName` - the character name

  - ### Method Detail

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### getName

          public String getName()

      Returns the character name (as defined by the Adobe glyph list).
      Returns:
        the character name

    - #### getUnicodeSequence

          public 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 IllegalStateException

      Returns the single Unicode value associated with this named character. Check `hasSingleUnicodeValue()` 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:
        `IllegalStateException` - if a Unicode sequence with more than one value is associated with the named character

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2025 Apache Software Foundation. All rights reserved.