Package com.ibm.icu.impl.coll
Class CollationDataBuilder
java.lang.Object
com.ibm.icu.impl.coll.CollationDataBuilder
Low-level CollationData builder.
Takes (character, CE) pairs and builds them into runtime data structures.
Supports characters with context prefixes and contraction suffixes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interfaceCollation element modifier.private static final classBuild-time context and CE32 for a code point.private static final classprivate static final classBuild-time collation element and character iterator. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CollationDataprotected CollationSettingsprotected UVector32protected UVector64protected ArrayList<CollationDataBuilder.ConditionalCE32> protected UnicodeSetprotected StringBuilderprivate intThe "era" of building intermediate contexts.protected CollationFastLatinBuilderprotected booleanprivate static final intprotected booleanprotected Normalizer2Implprotected Trie2Writableprotected UnicodeSet -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidadd(CharSequence prefix, CharSequence s, long[] ces, int cesLength) protected intaddCE(long ce) protected intaddCE32(int ce32) (package private) voidaddCE32(CharSequence prefix, CharSequence s, int ce32) protected intaddConditionalCE32(String context, int ce32) protected intaddContextTrie(int defaultCE32, CharsTrieBuilder trieBuilder) (package private) voidbuild(CollationData data) protected intprotected voidprotected voidprotected voidbuildMappings(CollationData data) protected voidprotected intcopyContractionsFromBaseCE32(StringBuilder context, int c, int ce32, CollationDataBuilder.ConditionalCE32 cond) Copies base contractions to a list of ConditionalCE32.(package private) voidcopyFrom(CollationDataBuilder src, CollationDataBuilder.CEModifier modifier) Copies all mappings from the src builder, with modifications.protected intcopyFromBaseCE32(int c, int ce32, boolean withContext) (package private) void(package private) intencodeCEs(long[] ces, int cesLength) Encodes the ces as either the returned ce32 by itself, or by storing an expansion, with the returned ce32 referring to that.protected intencodeExpansion(long[] ces, int start, int length) protected intencodeExpansion32(int[] newCE32s, int start, int length) protected intencodeOneCE(long ce) protected static intencodeOneCEAsCE32(long ce) private static voidenumRangeForCopy(int start, int end, int value, CollationDataBuilder.CopyHelper helper) protected intgetCE32FromOffsetCE32(boolean fromBase, int c, int ce32) protected intgetCEs(CharSequence s, int start, long[] ces, int cesLength) (package private) intgetCEs(CharSequence s, long[] ces, int cesLength) Looks up CEs for s and appends them to the ces array.(package private) intgetCEs(CharSequence prefix, CharSequence s, long[] ces, int cesLength) protected CollationDataBuilder.ConditionalCE32getConditionalCE32(int index) protected CollationDataBuilder.ConditionalCE32getConditionalCE32ForCE32(int ce32) protected booleangetJamoCE32s(int[] jamoCE32s) (package private) boolean(package private) void(package private) booleanisAssigned(int c) protected static booleanisBuilderContextCE32(int ce32) (package private) booleanisCompressibleLeadByte(int b) (package private) booleanisCompressiblePrimary(long p) protected final booleanprotected static intjamoCpFromIndex(int i) protected static intmakeBuilderContextCE32(int index) (package private) voidoptimize(UnicodeSet set) protected voidprotected void(package private) void
-
Field Details
-
IS_BUILDER_JAMO_CE32
private static final int IS_BUILDER_JAMO_CE32- See Also:
-
nfcImpl
-
base
-
baseSettings
-
trie
-
ce32s
-
ce64s
-
conditionalCE32s
-
contextChars
-
contexts
-
contextsEra
private int contextsEraThe "era" of building intermediate contexts. When the array of cached, temporary contexts overflows, then clearContexts() removes them all and invalidates the builtCE32 that used to point to built tries. SeeCollationDataBuilder.ConditionalCE32.era. -
unsafeBackwardSet
-
modified
protected boolean modified -
fastLatinEnabled
protected boolean fastLatinEnabled -
fastLatinBuilder
-
collIter
-
-
Constructor Details
-
CollationDataBuilder
CollationDataBuilder()
-
-
Method Details
-
initForTailoring
-
isCompressibleLeadByte
boolean isCompressibleLeadByte(int b) -
isCompressiblePrimary
boolean isCompressiblePrimary(long p) -
hasMappings
boolean hasMappings()- Returns:
- true if this builder has mappings (e.g., add() has been called)
-
isAssigned
boolean isAssigned(int c) - Returns:
- true if c has CEs in this builder
-
add
-
encodeCEs
int encodeCEs(long[] ces, int cesLength) Encodes the ces as either the returned ce32 by itself, or by storing an expansion, with the returned ce32 referring to that.add(p, s, ces, cesLength) = addCE32(p, s, encodeCEs(ces, cesLength))
-
addCE32
-
copyFrom
Copies all mappings from the src builder, with modifications. This builder here must not be built yet, and should be empty. -
optimize
-
suppressContractions
-
enableFastLatin
void enableFastLatin() -
build
-
getCEs
Looks up CEs for s and appends them to the ces array. Does not handle normalization: s should be in FCD form. Does not write completely ignorable CEs. Does not write beyond Collation.MAX_EXPANSION_LENGTH.- Returns:
- incremented cesLength
-
getCEs
-
getCE32FromOffsetCE32
protected int getCE32FromOffsetCE32(boolean fromBase, int c, int ce32) -
addCE
protected int addCE(long ce) -
addCE32
protected int addCE32(int ce32) -
addConditionalCE32
-
getConditionalCE32
-
getConditionalCE32ForCE32
-
makeBuilderContextCE32
protected static int makeBuilderContextCE32(int index) -
isBuilderContextCE32
protected static boolean isBuilderContextCE32(int ce32) -
encodeOneCEAsCE32
protected static int encodeOneCEAsCE32(long ce) -
encodeOneCE
protected int encodeOneCE(long ce) -
encodeExpansion
protected int encodeExpansion(long[] ces, int start, int length) -
encodeExpansion32
protected int encodeExpansion32(int[] newCE32s, int start, int length) -
copyFromBaseCE32
protected int copyFromBaseCE32(int c, int ce32, boolean withContext) -
copyContractionsFromBaseCE32
protected int copyContractionsFromBaseCE32(StringBuilder context, int c, int ce32, CollationDataBuilder.ConditionalCE32 cond) Copies base contractions to a list of ConditionalCE32. Sets cond.next to the index of the first new item and returns the index of the last new item. -
enumRangeForCopy
private static void enumRangeForCopy(int start, int end, int value, CollationDataBuilder.CopyHelper helper) -
getJamoCE32s
protected boolean getJamoCE32s(int[] jamoCE32s) -
setDigitTags
protected void setDigitTags() -
setLeadSurrogates
protected void setLeadSurrogates() -
buildMappings
-
clearContexts
protected void clearContexts() -
buildContexts
protected void buildContexts() -
buildContext
-
addContextTrie
-
buildFastLatinTable
-
getCEs
-
jamoCpFromIndex
protected static int jamoCpFromIndex(int i) -
isMutable
protected final boolean isMutable()
-