util
Class ToSafeASCIIMap

java.lang.Object
  extended by util.ToSafeASCIIMap

public class ToSafeASCIIMap
extends java.lang.Object

Defines a mapping of UCS characters to "safe" characters, or short strings of such characters, the safe characters all being in the visible ASCII range. A factory method provides access to the singleton instance.


Field Summary
static int A0
          Notional base index for the A0 - FF table.
protected static java.lang.String A0_FF_MAP
          Path for properties file giving the mapping for characters in the range U+00A0 to U+00FF.
 java.lang.String[] A0_TABLE
          The table giving the string for each character in the range A0 to FF.
static int A0_TABLE_SIZE
          Actual A0 - FF table size.
static java.lang.String DEFAULT_CHAR
          The string for the default character.
static int T_LIM
          Notional limit index for the A0 - FF table.
 
Method Summary
protected static java.lang.String getFirstPropsToken(java.util.Properties props, java.lang.String istr)
          Looks up the given string in the given properties set, and returns the first token in the result if possible, or returns null in any case of failure.
static ToSafeASCIIMap getToSafeASCIIMap()
          Factory method, returning the singleton map object.
 java.lang.String safe(char ch)
          Returns the safe ASCII string for the given character.
 java.lang.String safe(java.lang.String str)
          Returns the safe ASCII version of the given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

A0_FF_MAP

protected static final java.lang.String A0_FF_MAP
Path for properties file giving the mapping for characters in the range U+00A0 to U+00FF.

See Also:
Constant Field Values

A0

public static final int A0
Notional base index for the A0 - FF table.

See Also:
Constant Field Values

T_LIM

public static final int T_LIM
Notional limit index for the A0 - FF table.

See Also:
Constant Field Values

A0_TABLE_SIZE

public static final int A0_TABLE_SIZE
Actual A0 - FF table size.

See Also:
Constant Field Values

DEFAULT_CHAR

public static final java.lang.String DEFAULT_CHAR
The string for the default character.

See Also:
Constant Field Values

A0_TABLE

public final java.lang.String[] A0_TABLE
The table giving the string for each character in the range A0 to FF. The elements are strings rather than characters to allow for the case where a character can naturally be represented by a multi-character sequence, e.g. "ae" for "latin small letter a with diaeresis".

Method Detail

getToSafeASCIIMap

public static final ToSafeASCIIMap getToSafeASCIIMap()
Factory method, returning the singleton map object.


safe

public java.lang.String safe(char ch)
Returns the safe ASCII string for the given character.


safe

public java.lang.String safe(java.lang.String str)
Returns the safe ASCII version of the given string.


getFirstPropsToken

protected static java.lang.String getFirstPropsToken(java.util.Properties props,
                                                     java.lang.String istr)
Looks up the given string in the given properties set, and returns the first token in the result if possible, or returns null in any case of failure.