Top Fields Constructors Methods
com.ibm.icu.impl.coll

public final Class CollationFastLatin

extends Object
Class Inheritance
Imports
com.ibm.icu.lang.UScript, com.ibm.icu.text.Collator

Field Summary

Modifier and TypeField and Description
pack-priv static final int
public static final int
BAIL_OUT_RESULT

Comparison return value when the regular comparison must be used.

pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
CONTR_CHAR_MASK

Contraction result first word bits 8..0 contain the second contraction character, as a char index 0..NUM_FAST_CHARS-1.

pack-priv static final int
CONTR_LENGTH_SHIFT

Contraction result first word bits 10..9 contain the result length: 1=bail out, 2=one mini CE, 3=two mini CEs

pack-priv static final int
CONTRACTION

Contraction with one fast Latin character.

pack-priv static final int
pack-priv static final int
EXPANSION

An expansion encodes two CEs.

pack-priv static final int
public static final int
public static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
MAX_SHORT

The highest primary weight is reserved for U+FFFF.

pack-priv static final int
pack-priv static final int
pack-priv static final int
MIN_LONG

Encodes one CE with a long/low mini primary (there are 128).

pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
MIN_SHORT

Encodes one CE with a short/high primary (there are 60), plus a secondary CE if the secondary weight is high.

pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
SEC_OFFSET

Lookup: Add this offset to secondary weights, except for completely ignorable CEs.

pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
TER_OFFSET

Lookup: Add this offset to tertiary weights, except for completely ignorable CEs.

pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
public static final int
VERSION

Fast Latin format version (one byte 1..FF).

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static int
compareUTF16(char[] table, char[] primaries, int options, CharSequence left, CharSequence right, int startIndex)

private static int
getCases(int variableTop, boolean strengthIsPrimary, int pair)

pack-priv static int
getCharIndex(char c)

public static int
getOptions(CollationData data, CollationSettings settings, char[] primaries)

Computes the options value for the compare functions and writes the precomputed primary weights.

private static int
getPrimaries(int variableTop, int pair)

private static int
getQuaternaries(int variableTop, int pair)

private static int
getSecondaries(int variableTop, int pair)

private static int
private static int
getTertiaries(int variableTop, boolean withCaseBits, int pair)

private static int
lookup(char[] table, int c)

private static long
nextPair(char[] table, int c, int ce, CharSequence s16, int sIndex)

Java returns a negative result (use the '~' operator) if sIndex is to be incremented.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BAIL_OUTback to summary
pack-priv static final int BAIL_OUT
BAIL_OUT_RESULTback to summary
public static final int BAIL_OUT_RESULT

Comparison return value when the regular comparison must be used. The exact value is not relevant for the format version.

CASE_AND_TERTIARY_MASKback to summary
pack-priv static final int CASE_AND_TERTIARY_MASK
CASE_MASKback to summary
pack-priv static final int CASE_MASK
COMMON_SECback to summary
pack-priv static final int COMMON_SEC
COMMON_SEC_PLUS_OFFSETback to summary
pack-priv static final int COMMON_SEC_PLUS_OFFSET
COMMON_TERback to summary
pack-priv static final int COMMON_TER
COMMON_TER_PLUS_OFFSETback to summary
pack-priv static final int COMMON_TER_PLUS_OFFSET
CONTR_CHAR_MASKback to summary
pack-priv static final int CONTR_CHAR_MASK

Contraction result first word bits 8..0 contain the second contraction character, as a char index 0..NUM_FAST_CHARS-1. Each contraction list is terminated with a word containing CONTR_CHAR_MASK.

CONTR_LENGTH_SHIFTback to summary
pack-priv static final int CONTR_LENGTH_SHIFT

Contraction result first word bits 10..9 contain the result length: 1=bail out, 2=one mini CE, 3=two mini CEs

CONTRACTIONback to summary
pack-priv static final int CONTRACTION

Contraction with one fast Latin character. Use INDEX_MASK to find the start of the contraction list after the fixed table. The first entry contains the default mapping. Otherwise use CONTR_CHAR_MASK for the contraction character index (in ascending order). Use CONTR_LENGTH_SHIFT for the length of the entry (1=BAIL_OUT, 2=one CE, 3=two CEs). Also, U+0000 maps to a contraction entry, so that the fast path need not check for NUL termination. It usually maps to a contraction list with only the completely ignorable default value.

EOSback to summary
pack-priv static final int EOS
EXPANSIONback to summary
pack-priv static final int EXPANSION

An expansion encodes two CEs. Use INDEX_MASK to find the pair of CEs after the fixed table. The higher a mini CE value, the easier it is to process. For expansions and higher, no context needs to be considered.

INDEX_MASKback to summary
pack-priv static final int INDEX_MASK
LATIN_LIMITback to summary
public static final int LATIN_LIMIT
LATIN_MAXback to summary
public static final int LATIN_MAX
LATIN_MAX_UTF8_LEADback to summary
pack-priv static final int LATIN_MAX_UTF8_LEAD
LONG_INCback to summary
pack-priv static final int LONG_INC
LONG_PRIMARY_MASKback to summary
pack-priv static final int LONG_PRIMARY_MASK
LOWER_CASEback to summary
pack-priv static final int LOWER_CASE
MAX_LONGback to summary
pack-priv static final int MAX_LONG
MAX_SEC_AFTERback to summary
pack-priv static final int MAX_SEC_AFTER
MAX_SEC_BEFOREback to summary
pack-priv static final int MAX_SEC_BEFORE
MAX_SEC_HIGHback to summary
pack-priv static final int MAX_SEC_HIGH
MAX_SHORTback to summary
pack-priv static final int MAX_SHORT

The highest primary weight is reserved for U+FFFF.

MAX_TER_AFTERback to summary
pack-priv static final int MAX_TER_AFTER
MERGE_WEIGHTback to summary
pack-priv static final int MERGE_WEIGHT
MIN_LONGback to summary
pack-priv static final int MIN_LONG

Encodes one CE with a long/low mini primary (there are 128). All potentially-variable primaries must be in this range, to make the short-primary path as fast as possible.

MIN_SEC_AFTERback to summary
pack-priv static final int MIN_SEC_AFTER
MIN_SEC_BEFOREback to summary
pack-priv static final int MIN_SEC_BEFORE
MIN_SEC_HIGHback to summary
pack-priv static final int MIN_SEC_HIGH
MIN_SHORTback to summary
pack-priv static final int MIN_SHORT

Encodes one CE with a short/high primary (there are 60), plus a secondary CE if the secondary weight is high. Fast handling: At least all letter primaries should be in this range.

NUM_FAST_CHARSback to summary
pack-priv static final int NUM_FAST_CHARS
PUNCT_LIMITback to summary
pack-priv static final int PUNCT_LIMIT
PUNCT_STARTback to summary
pack-priv static final int PUNCT_START
SEC_INCback to summary
pack-priv static final int SEC_INC
SEC_OFFSETback to summary
pack-priv static final int SEC_OFFSET

Lookup: Add this offset to secondary weights, except for completely ignorable CEs. Must be greater than any special value, e.g., MERGE_WEIGHT. The exact value is not relevant for the format version.

SECONDARY_MASKback to summary
pack-priv static final int SECONDARY_MASK
SHORT_INCback to summary
pack-priv static final int SHORT_INC
SHORT_PRIMARY_MASKback to summary
pack-priv static final int SHORT_PRIMARY_MASK
TER_OFFSETback to summary
pack-priv static final int TER_OFFSET

Lookup: Add this offset to tertiary weights, except for completely ignorable CEs. Must be greater than any special value, e.g., MERGE_WEIGHT. Must be greater than case bits as well, so that with combined case+tertiary weights plus the offset the tertiary bits does not spill over into the case bits. The exact value is not relevant for the format version.

TERTIARY_MASKback to summary
pack-priv static final int TERTIARY_MASK
TWO_CASES_MASKback to summary
pack-priv static final int TWO_CASES_MASK
TWO_COMMON_SEC_PLUS_OFFSETback to summary
pack-priv static final int TWO_COMMON_SEC_PLUS_OFFSET
TWO_COMMON_TER_PLUS_OFFSETback to summary
pack-priv static final int TWO_COMMON_TER_PLUS_OFFSET
TWO_LONG_PRIMARIES_MASKback to summary
pack-priv static final int TWO_LONG_PRIMARIES_MASK
TWO_LOWER_CASESback to summary
pack-priv static final int TWO_LOWER_CASES
TWO_SEC_OFFSETSback to summary
pack-priv static final int TWO_SEC_OFFSETS
TWO_SECONDARIES_MASKback to summary
pack-priv static final int TWO_SECONDARIES_MASK
TWO_SHORT_PRIMARIES_MASKback to summary
pack-priv static final int TWO_SHORT_PRIMARIES_MASK
TWO_TER_OFFSETSback to summary
pack-priv static final int TWO_TER_OFFSETS
TWO_TERTIARIES_MASKback to summary
pack-priv static final int TWO_TERTIARIES_MASK
VERSIONback to summary
public static final int VERSION

Fast Latin format version (one byte 1..FF). Must be incremented for any runtime-incompatible changes, in particular, for changes to any of the following constants. When the major version number of the main data format changes, we can reset this fast Latin version to 1.

Constructor Detail

CollationFastLatinback to summary
private CollationFastLatin()

Method Detail

compareUTF16back to summary
public static int compareUTF16(char[] table, char[] primaries, int options, CharSequence left, CharSequence right, int startIndex)
getCasesback to summary
private static int getCases(int variableTop, boolean strengthIsPrimary, int pair)
getCharIndexback to summary
pack-priv static int getCharIndex(char c)
getOptionsback to summary
public static int getOptions(CollationData data, CollationSettings settings, char[] primaries)

Computes the options value for the compare functions and writes the precomputed primary weights. Returns -1 if the Latin fastpath is not supported for the data and settings. The capacity must be LATIN_LIMIT.

getPrimariesback to summary
private static int getPrimaries(int variableTop, int pair)
getQuaternariesback to summary
private static int getQuaternaries(int variableTop, int pair)
getSecondariesback to summary
private static int getSecondaries(int variableTop, int pair)
getSecondariesFromOneShortCEback to summary
private static int getSecondariesFromOneShortCE(int ce)
getTertiariesback to summary
private static int getTertiaries(int variableTop, boolean withCaseBits, int pair)
lookupback to summary
private static int lookup(char[] table, int c)
nextPairback to summary
private static long nextPair(char[] table, int c, int ce, CharSequence s16, int sIndex)

Java returns a negative result (use the '~' operator) if sIndex is to be incremented. C++ modifies sIndex.