org.enhydra.xml.io
Class CharacterSet

java.lang.Object
  |
  +--org.enhydra.xml.io.CharacterSet
Direct Known Subclasses:
ISO8859CharacterSet, ShiftJisCharacterSet

class CharacterSet
extends Object

Information and operations associated with a specific character set. A global table of these objects is built by the Encodings class. Instances are immutable, classes can be derived to define override the operations that can't be handled by the default static parameters.


Constructor Summary
CharacterSet(String name, int charSize, String mimePreferred, String[] aliases)
          Constructor
 
Method Summary
 String[] getAliases()
          Get the aliases
 int getCharSize()
          Get the character size, in bits
 int getMaxCharValue()
          Get the maximum value for a character
 String getMIMEPreferred()
          Get the MIME preferred name or null if unspecified
 String getName()
          Get the name
 boolean isCompatible(CharacterSet otherSet)
          Determine if another character set is compatible to this character set.
 boolean isValid(char ch)
          Determine if a unicode character has a valid mapping to this character set.
 boolean sameValidCharRange(CharacterSet otherSet)
          Deprecated. use {qlink #isCompatible} instead
 String toString()
          Get string representation of object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CharacterSet

public CharacterSet(String name,
                    int charSize,
                    String mimePreferred,
                    String[] aliases)
Constructor

Method Detail

getName

public final String getName()
Get the name


getCharSize

public final int getCharSize()
Get the character size, in bits


getMaxCharValue

public final int getMaxCharValue()
Get the maximum value for a character


getMIMEPreferred

public final String getMIMEPreferred()
Get the MIME preferred name or null if unspecified


getAliases

public final String[] getAliases()
Get the aliases


isValid

public boolean isValid(char ch)
Determine if a unicode character has a valid mapping to this character set.

WARNING: This is only well implemented for a few character sets on an as-needed basis; the rest just go by the character size.


sameValidCharRange

public boolean sameValidCharRange(CharacterSet otherSet)
Deprecated. use {qlink #isCompatible} instead

Determine if another character set has the same valid range of character codes as this character set. That is, will isValid() return the same value for any arbitrary unicode character.

WARNING: This is only well implemented for a few character sets on an as-needed basis; the rest just go by the character size.


isCompatible

public boolean isCompatible(CharacterSet otherSet)
Determine if another character set is compatible to this character set. "Compatible" means that for every character where otherSet.isValid() return true, this.isValid() will return true as well.

WARNING: This is only well implemented for a few character sets on an as-needed basis; the rest just go by the character set size.


toString

public String toString()
Get string representation of object

Overrides:
toString in class Object


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.