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

public final Class CollationFCD

extends Object
Class Inheritance
Imports
com.ibm.icu.text.UTF16

Data and functions for the FCD check fast path. The fast path looks at a pair of 16-bit code units and checks whether there is an FCD boundary between them; there is if the first unit has a trailing ccc=0 (!hasTccc(first)) or the second unit has a leading ccc=0 (!hasLccc(second)), or both. When the fast path finds a possible non-boundary, then the FCD check slow path looks at the actual sequence of FCD values. This is a pure optimization. The fast path must at least find all possible non-boundaries. If the fast path is too pessimistic, it costs performance. For a pair of BMP characters, the fast path tests are precise (1 bit per character). For a supplementary code point, the two units are its lead and trail surrogates. We set hasTccc(lead)=true if any of its 1024 associated supplementary code points has lccc!=0 or tccc!=0. We set hasLccc(trail)=true for all trail surrogates. As a result, we leave the fast path if the lead surrogate might start a supplementary code point that is not FCD-inert. (So the fast path need not detect that there is a surrogate pair, nor look ahead to the next full code point.) hasLccc(lead)=true if any of its 1024 associated supplementary code points has lccc!=0, for fast boundary checking between BMP & supplementary. hasTccc(trail)=false: It should only be tested for unpaired trail surrogates which are FCD-inert.

Field Summary

Modifier and TypeField and Description
private static final int[]
private static final byte[]
private static final int[]
private static final byte[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static boolean
hasLccc(int c)

public static boolean
hasTccc(int c)

pack-priv static boolean

Returns:

true if fcd16 is from U+0F73, U+0F75 or U+0F81
isFCD16OfTibetanCompositeVowel
(int
the FCD value (lccc/tccc combination) of a code point
fcd16
)

Tibetan composite vowel signs (U+0F73, U+0F75, U+0F81) must be decomposed before reaching the core collation code, or else some sequences including them, even ones passing the FCD check, do not yield canonically equivalent results.

pack-priv static boolean

Returns:

true if c is U+0F73, U+0F75 or U+0F81 or one of several other Tibetan characters
maybeTibetanCompositeVowel
(int
a code point
c
)

Tibetan composite vowel signs (U+0F73, U+0F75, U+0F81) must be decomposed before reaching the core collation code, or else some sequences including them, even ones passing the FCD check, do not yield canonically equivalent results.

pack-priv static boolean
mayHaveLccc(int c)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lcccBitsback to summary
private static final int[] lcccBits
lcccIndexback to summary
private static final byte[] lcccIndex
tcccBitsback to summary
private static final int[] tcccBits
tcccIndexback to summary
private static final byte[] tcccIndex

Constructor Detail

CollationFCDback to summary
public CollationFCD()

Method Detail

hasLcccback to summary
public static boolean hasLccc(int c)
hasTcccback to summary
public static boolean hasTccc(int c)
isFCD16OfTibetanCompositeVowelback to summary
pack-priv static boolean isFCD16OfTibetanCompositeVowel(int fcd16)

Tibetan composite vowel signs (U+0F73, U+0F75, U+0F81) must be decomposed before reaching the core collation code, or else some sequences including them, even ones passing the FCD check, do not yield canonically equivalent results. They have distinct lccc/tccc combinations: 129/130 or 129/132.

Parameters
fcd16:int

the FCD value (lccc/tccc combination) of a code point

Returns:boolean

true if fcd16 is from U+0F73, U+0F75 or U+0F81

maybeTibetanCompositeVowelback to summary
pack-priv static boolean maybeTibetanCompositeVowel(int c)

Tibetan composite vowel signs (U+0F73, U+0F75, U+0F81) must be decomposed before reaching the core collation code, or else some sequences including them, even ones passing the FCD check, do not yield canonically equivalent results. This is a fast and imprecise test.

Parameters
c:int

a code point

Returns:boolean

true if c is U+0F73, U+0F75 or U+0F81 or one of several other Tibetan characters

mayHaveLcccback to summary
pack-priv static boolean mayHaveLccc(int c)