org.foray.ps.encode
Class CharSet4a

java.lang.Object
  extended by org.foray.ps.encode.CharSet4a
All Implemented Interfaces:
Serializable, org.axsl.ps.CharSet
Direct Known Subclasses:
CharSetExtendedRoman, CharSetWindowsANSI

public class CharSet4a
extends Object
implements org.axsl.ps.CharSet, Serializable

The FOray implementation of CharSet.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.axsl.ps.CharSet
org.axsl.ps.CharSet.Predefined
 
Field Summary
static long serialVersionUID
          Constant needed for serialization.
 
Constructor Summary
CharSet4a(String name, char[] characterSet)
          Constructor suitable for character sets that contain only 16-bit characters.
CharSet4a(String name, int[] characterSet)
          General constructor suitable for character sets containing 16-bit codePoints, 32-bit code points, or both.
 
Method Summary
 int getIndex(int codePoint)
           
 String getName()
          Returns the name of this character set.
static CharSet4a getRegisteredCharSet(org.axsl.ps.CharSet.Predefined predefined)
          Returns a predefined character set from its enumeration.
static CharSet4a getRegisteredCharSet(String name)
          This is a factory method that either finds or creates the known predefined CharSet instances.
 boolean isStatic()
          Indicates whether the data in this character set is static, that is, tied entirely to the class itself and not built dynamically.
 int size()
          Returns the size, in characters, of this character set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Constant needed for serialization.

See Also:
Constant Field Values
Constructor Detail

CharSet4a

public CharSet4a(String name,
                 char[] characterSet)
Constructor suitable for character sets that contain only 16-bit characters. If there are any 32-bit code points in the character set, use CharSet4a(String, int[]) instead.

Parameters:
name - The name of this character set.
characterSet - The array containing the code points in this character set.

CharSet4a

public CharSet4a(String name,
                 int[] characterSet)
General constructor suitable for character sets containing 16-bit codePoints, 32-bit code points, or both. If all code points in the character set are 16-bit (less than or equal to 0xFFFF), then CharSet4a(String, char[]) may also be used.

Parameters:
name - The name of this character set.
characterSet - The array containing the code points in this character set.
Method Detail

getName

public String getName()
Returns the name of this character set.

Returns:
The name of this character set.

getIndex

public int getIndex(int codePoint)
Specified by:
getIndex in interface org.axsl.ps.CharSet

getRegisteredCharSet

public static CharSet4a getRegisteredCharSet(String name)
This is a factory method that either finds or creates the known predefined CharSet instances.

Parameters:
name - The name of the predefined charset to be returned.
Returns:
The CharSet instance for name, or null if name does not describe a predefined character set.

getRegisteredCharSet

public static CharSet4a getRegisteredCharSet(org.axsl.ps.CharSet.Predefined predefined)
Returns a predefined character set from its enumeration.

Parameters:
predefined - The enumeration of the predefined character sets.
Returns:
The character set for predefined.

size

public int size()
Returns the size, in characters, of this character set.

Specified by:
size in interface org.axsl.ps.CharSet
Returns:
The size of this character set.

isStatic

public boolean isStatic()
Indicates whether the data in this character set is static, that is, tied entirely to the class itself and not built dynamically. This is used primarily to determine whether the instance should actually be serialized. Static subclasses should override this method.

Returns:
True iff all data in this glyph list is static and does not need to be serialized.


Copyright © 2017. All rights reserved.