Fields Summary |
---|
public static final int | TERMINAL_CODE_POINTA value which is used to terminate the code point sequence when
traversing possible contractions. |
public static final int | INVALID_BOOKMARK_VALUEA value which represents an invalid bookmark. It can be returned by the
{@link #getChildBookmark} method when trying to get the bookmark for
a non-existing contraction. |
protected static final int | L1_MASKA mask to decode the L1 weight value of an encoded collation element. |
protected static final int | L2_MASKA mask to decode the L2 weight value of an encoded collation element. |
protected static final int | L3_MASKA mask to decode the L3 weight value of an encoded collation element. |
protected static final int | VW_FLAGA flag indicating a code point with a variable weight. |
protected static final int | SINGLE_CE_FLAGA flag indicating a single encoded collation element. |
protected static final int | BOOKMARK_FLAGA flag indicating a bookmark. |
protected static final int | L2_SHIFTA shift value to decode the L2 weight value of an encoded collation
element. |
protected static final int | L3_SHIFTA shift value to decode the L3 weight value of an encoded collation
element. |
Methods Summary |
---|
public abstract int | getChildBookmark(int bookmark, int cp)This method can be used to traverse the contractions. The traversing
starts when the {@link #getCollationElements} method returns a bookmark
instead of collation elements. The returned bookmark, which represents
a code point sequence consisting only of one code point, can be further
tested if it's extensible by various other code points.
If a partial match is found, the method returns another bookmark which
represents the new sequence. The new bookmark can be further "refined"
as well. To get the collation elements for the sequence, the sequence
has to be terminated by the
getChildBookmark(bookmark, TERMINAL_CODE_POINT) call.
If the call returns a valid bookmark, it is guaranteed, that the
getCollationElements method will return the collation
elements for this final bookmark.
If no match can be found for the given bookmark and the code point
value, the method returns INVALID_BOOKMARK_VALUE .
|
public abstract int | getCollationElements(int[] buffer, int offset, int cp)Returns the collation element/elements for the given code point/points.
Each returned collation element is encoded in a single integer value,
which can be further decoded by the static methods of this class.
There are three types of possible return value and two types of the
input values.
If the parameters are an integer buffer, an offset to this buffer and
a single code point, the method can return:
-
A single encoded collation element value, when the code point
decomposes into one collation element and it isn't a starting
code point of any contraction. In this case nothing is written
into the buffer.
-
The number of encoded collation elements, when the code point
decomposes into more than one collation elements and it isn't
a starting code point of any contraction. The encoded collation
elements are written to the buffer on the given offset.
-
A bookmark value, when the given code point is a starting code
point of a contraction. Nothing is written into the buffer.
If the parameters are an integer buffer, an offset to this buffer and
a bookmark, the method can return:
-
A single encoded collation element value, when the code point
sequence behind the bookmark decomposes into one collation
element. Nothing is written into the buffer.
-
The number of encoded collation elements, when the code point
sequence behind the bookmark decomposes into more than one
collation elements. The encoded collation elements are written
to the buffer on the given offset.
-
A zero value, when the given bookmark is invalid or it doesn't
target the complete (terminated) code point sequence.
|
public static final int | getL1(int ecol)Returns the L1 weight value of an encoded collation element.
return ecol & L1_MASK;
|
public static final int | getL2(int ecol)Returns the L2 weight value of an encoded collation element.
return (ecol & L2_MASK) >>> L2_SHIFT;
|
public static final int | getL3(int ecol)Returns the L3 weight value of an encoded collation element.
return (ecol & L3_MASK) >>> L3_SHIFT;
|
public abstract int | getMaxContractionLength()Returns the length of the longest possible contraction in the table.
|
public static final boolean | isBookmark(int cbc)Test if the given value is a bookmark.
return (cbc & BOOKMARK_FLAG) != 0;
|
public static final boolean | isSingleCollationEl(int cbc)Test if the given value is a single encoded collation element.
return (cbc & SINGLE_CE_FLAG) != 0;
|
public static final boolean | isVariableElement(int ecol)Test if the given collation element has a variable weight.
return (ecol & VW_FLAG) != 0;
|