FileDocCategorySizeDatePackage
NormalizationTable.javaAPI DocphoneME MR2 API (J2ME)5907Wed May 02 18:00:46 BST 2007com.sun.j2me.global

NormalizationTable

public abstract class NormalizationTable extends Object
This interface is used to get the unicode decomposition for the given unicode character.

Fields Summary
protected static final int
CODE_POINT_MASK
A mask to decode the code point value.
protected static final int
COMBINING_CLASS_MASK
A mask to decode the combining class.
protected static final int
UNSAFE_CODE_POINT_FLAG
A flag indicating a code point that is unsafe to start UCA with.
protected static final int
IGNORABLE_CODE_POINT_FLAG
A flag indicating an ignorable code point.
protected static final int
LOGICAL_ORDER_EXCEPTION_FLAG
A flag indicating a code point with a logical order exception.
protected static final int
SINGLE_CODE_POINT_FLAG
A flag indicating a single encoded code point.
protected static final int
COMBINING_CLASS_SHIFT
A shift value to decode the combining class.
Constructors Summary
Methods Summary
public abstract intgetCanonicalDecomposition(int[] buffer, int offset, int cp)
Gets the canonical decomposition elements for the given unicode character. The decompositon is returned as a single or an array of encoded code points. The encoded values can be further decoded by the static methods of this class. The return value depends on the number of code points to which the given code point decomposes. If it decomposes to a single code point, its encoded value is returned, otherwise the decomposition is stored in the given array and the method returns only the length of the decomposition.

param
buffer an array for the decomposition
param
offset the offset from the beginning of the array, where to place the decomposition
param
cp the code point to decompose
return
the length of the decomposition or a single encoded code point
see
#isSingleCodePoint

public static final intgetCodePoint(int ecp)
Returns the code point value of an encoded code point.

param
ecp the encoded code point
return
the code point value

    
                              
          
        return ecp & CODE_POINT_MASK;
    
public static final intgetCombiningClass(int ecp)
Returns the combining class of an encoded code point.

param
ecp the encoded code point
return
the combining class

        return (ecp & COMBINING_CLASS_MASK) >>> COMBINING_CLASS_SHIFT;
    
public abstract intgetMaxDecompositionLength()
Returns the length of the longest decomposition in the table.

return
the maximum decomposition length

public static final booleanhasLogicalOrderException(int ecp)
Checks if the given code point has a logical order exception.

param
ecp the encoded code point
return
true if the code point has a logical order exception

        return (ecp & LOGICAL_ORDER_EXCEPTION_FLAG) != 0;
    
public static final booleanisIgnorable(int ecp)
Returns true if the given code point is ignorable for the collation algorithm (at all levels).

param
ecp the encoded code point
return
true if the code point is ignorable

        return (ecp & IGNORABLE_CODE_POINT_FLAG) != 0;
    
public static final booleanisSingleCodePoint(int codeOrCount)
Returns true if the given value represents a single encoded code point and false if it's a number of code points.

param
codeOrCount the value
return
true if the value represent a single code point, false if it's only a number of code points
see
#getCanonicalDecomposition

        return (codeOrCount & SINGLE_CODE_POINT_FLAG) != 0;
    
public static final booleanisStable(int ecp)
Returns true if the given code point has a zero combining class.

param
ecp the encoded code point
return
true if the code point has a zero combining class

        return (ecp & COMBINING_CLASS_MASK) == 0;
    
public static final booleanisUnsafe(int ecp)
Returns true if the given code point is unsafe to start the collation algorithm with.

param
ecp the encoded code point
return
true if the code point is unsafe

        return (ecp & UNSAFE_CODE_POINT_FLAG) != 0;