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

public final Class CollationKeys

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public abstract static class
private static class

Field Summary

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

Map from collation strength (UColAttributeValue) to a mask of Collation.Level bits up to that strength, excluding the CASE_LEVEL which is independent of the strength, and excluding IDENTICAL_LEVEL which this function does not write.

private static final int
private static final int
private static final int
private static final int
private static final int
pack-priv static final int
private static final int
private static final int
private static final int
public static final CollationKeys.LevelCallback
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static CollationKeys.SortKeyLevel
getSortKeyLevel(int levels, int level)

public static void
writeSortKeyUpToQuaternary(CollationIterator iter, boolean[] compressibleBytes, CollationSettings settings, CollationKeys.SortKeyByteSink sink, int minLevel, CollationKeys.LevelCallback callback, boolean preflight)

Writes the sort key bytes for minLevel up to the iterator data's strength.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CASE_LOWER_FIRST_COMMON_HIGHback to summary
private static final int CASE_LOWER_FIRST_COMMON_HIGH
CASE_LOWER_FIRST_COMMON_LOWback to summary
private static final int CASE_LOWER_FIRST_COMMON_LOW
CASE_LOWER_FIRST_COMMON_MAX_COUNTback to summary
private static final int CASE_LOWER_FIRST_COMMON_MAX_COUNT
CASE_LOWER_FIRST_COMMON_MIDDLEback to summary
private static final int CASE_LOWER_FIRST_COMMON_MIDDLE
CASE_UPPER_FIRST_COMMON_HIGHback to summary
private static final int CASE_UPPER_FIRST_COMMON_HIGH
Annotations
@SuppressWarnings:unused
CASE_UPPER_FIRST_COMMON_LOWback to summary
private static final int CASE_UPPER_FIRST_COMMON_LOW
CASE_UPPER_FIRST_COMMON_MAX_COUNTback to summary
private static final int CASE_UPPER_FIRST_COMMON_MAX_COUNT
levelMasksback to summary
private static final int[] levelMasks

Map from collation strength (UColAttributeValue) to a mask of Collation.Level bits up to that strength, excluding the CASE_LEVEL which is independent of the strength, and excluding IDENTICAL_LEVEL which this function does not write.

QUAT_COMMON_HIGHback to summary
private static final int QUAT_COMMON_HIGH
QUAT_COMMON_LOWback to summary
private static final int QUAT_COMMON_LOW
QUAT_COMMON_MAX_COUNTback to summary
private static final int QUAT_COMMON_MAX_COUNT
QUAT_COMMON_MIDDLEback to summary
private static final int QUAT_COMMON_MIDDLE
QUAT_SHIFTED_LIMIT_BYTEback to summary
private static final int QUAT_SHIFTED_LIMIT_BYTE
SEC_COMMON_HIGHback to summary
pack-priv static final int SEC_COMMON_HIGH
SEC_COMMON_LOWback to summary
private static final int SEC_COMMON_LOW
SEC_COMMON_MAX_COUNTback to summary
private static final int SEC_COMMON_MAX_COUNT
SEC_COMMON_MIDDLEback to summary
private static final int SEC_COMMON_MIDDLE
SIMPLE_LEVEL_FALLBACKback to summary
public static final CollationKeys.LevelCallback SIMPLE_LEVEL_FALLBACK
TER_LOWER_FIRST_COMMON_HIGHback to summary
private static final int TER_LOWER_FIRST_COMMON_HIGH
TER_LOWER_FIRST_COMMON_LOWback to summary
private static final int TER_LOWER_FIRST_COMMON_LOW
TER_LOWER_FIRST_COMMON_MAX_COUNTback to summary
private static final int TER_LOWER_FIRST_COMMON_MAX_COUNT
TER_LOWER_FIRST_COMMON_MIDDLEback to summary
private static final int TER_LOWER_FIRST_COMMON_MIDDLE
TER_ONLY_COMMON_HIGHback to summary
private static final int TER_ONLY_COMMON_HIGH
TER_ONLY_COMMON_LOWback to summary
private static final int TER_ONLY_COMMON_LOW
TER_ONLY_COMMON_MAX_COUNTback to summary
private static final int TER_ONLY_COMMON_MAX_COUNT
TER_ONLY_COMMON_MIDDLEback to summary
private static final int TER_ONLY_COMMON_MIDDLE
TER_UPPER_FIRST_COMMON_HIGHback to summary
private static final int TER_UPPER_FIRST_COMMON_HIGH
TER_UPPER_FIRST_COMMON_LOWback to summary
private static final int TER_UPPER_FIRST_COMMON_LOW
TER_UPPER_FIRST_COMMON_MAX_COUNTback to summary
private static final int TER_UPPER_FIRST_COMMON_MAX_COUNT
TER_UPPER_FIRST_COMMON_MIDDLEback to summary
private static final int TER_UPPER_FIRST_COMMON_MIDDLE

Constructor Detail

CollationKeysback to summary
private CollationKeys()

Method Detail

getSortKeyLevelback to summary
private static CollationKeys.SortKeyLevel getSortKeyLevel(int levels, int level)
writeSortKeyUpToQuaternaryback to summary
public static void writeSortKeyUpToQuaternary(CollationIterator iter, boolean[] compressibleBytes, CollationSettings settings, CollationKeys.SortKeyByteSink sink, int minLevel, CollationKeys.LevelCallback callback, boolean preflight)

Writes the sort key bytes for minLevel up to the iterator data's strength. Optionally writes the case level. Stops writing levels when callback.needToWrite(level) returns false. Separates levels with the LEVEL_SEPARATOR_BYTE but does not write a TERMINATOR_BYTE.

com.ibm.icu.impl.coll back to summary

public Class CollationKeys.LevelCallback

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean

Returns:

true if the level is to be written (the base class implementation always returns true)
needToWrite
(int
The next level about to be written to the ByteSink.
level
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LevelCallbackback to summary
public LevelCallback()

Method Detail

needToWriteback to summary
pack-priv boolean needToWrite(int level)
Parameters
level:int

The next level about to be written to the ByteSink.

Returns:boolean

true if the level is to be written (the base class implementation always returns true)

com.ibm.icu.impl.coll back to summary

public abstract Class CollationKeys.SortKeyByteSink

extends Object
Class Inheritance
Known Direct Subclasses
com.ibm.icu.text.RuleBasedCollator.CollationKeyByteSink

Field Summary

Modifier and TypeField and Description
private int
protected byte[]

Constructor Summary

AccessConstructor and Description
public
SortKeyByteSink(byte[] dest)

Method Summary

Modifier and TypeMethod and Description
public void
Append(byte[]
the array of byte
bytes
,
int
the length of bytes to be appended
n
)

public void
Append(int b)

protected abstract void
AppendBeyondCapacity(byte[]
the array of byte
bytes
,
int
the start index within the array to be appended
start
,
int
the length of bytes to be appended
n
,
int
the length of buffer required to store the entire data (i.e. already appended bytes + bytes to be appended by this method)
length
)

public int
public int
public boolean
protected abstract boolean
Resize(int appendCapacity, int length)

public void
setBufferAndAppended(byte[] dest, int app)

Needed in Java for when we write to the buffer directly.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

appended_back to summary
private int appended_
buffer_back to summary
protected byte[] buffer_

Constructor Detail

SortKeyByteSinkback to summary
public SortKeyByteSink(byte[] dest)

Method Detail

Appendback to summary
public void Append(byte[] bytes, int n)
Parameters
bytes:byte[]

the array of byte

n:int

the length of bytes to be appended

Appendback to summary
public void Append(int b)
AppendBeyondCapacityback to summary
protected abstract void AppendBeyondCapacity(byte[] bytes, int start, int n, int length)
Parameters
bytes:byte[]

the array of byte

start:int

the start index within the array to be appended

n:int

the length of bytes to be appended

length:int

the length of buffer required to store the entire data (i.e. already appended bytes + bytes to be appended by this method)

GetRemainingCapacityback to summary
public int GetRemainingCapacity()
NumberOfBytesAppendedback to summary
public int NumberOfBytesAppended()
Overflowedback to summary
public boolean Overflowed()
Resizeback to summary
protected abstract boolean Resize(int appendCapacity, int length)
setBufferAndAppendedback to summary
public void setBufferAndAppended(byte[] dest, int app)

Needed in Java for when we write to the buffer directly. In C++, the SortKeyByteSink is a subclass of ByteSink and lower-level code can write to that.

Todo

Can we make Java SortKeyByteSink have-a ByteArrayWrapper and write through to it? Or maybe create interface ByteSink, have SortKeyByteSink implement it, and have BOCSU write to that??

com.ibm.icu.impl.coll back to summary

private final Class CollationKeys.SortKeyLevel

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv byte[]
private static final int
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
appendByte(int b)

pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv byte[]
data()

private boolean
ensureCapacity(int appendCapacity)

pack-priv byte
getAt(int index)

pack-priv boolean
pack-priv int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
pack-priv byte[] buffer
INITIAL_CAPACITYback to summary
private static final int INITIAL_CAPACITY
lenback to summary
pack-priv int len

Constructor Detail

SortKeyLevelback to summary
pack-priv SortKeyLevel()

Method Detail

appendByteback to summary
pack-priv void appendByte(int b)
appendReverseWeight16back to summary
pack-priv void appendReverseWeight16(int w)
appendToback to summary
pack-priv void appendTo(CollationKeys.SortKeyByteSink sink)
appendWeight16back to summary
pack-priv void appendWeight16(int w)
appendWeight32back to summary
pack-priv void appendWeight32(long w)
databack to summary
pack-priv byte[] data()
ensureCapacityback to summary
private boolean ensureCapacity(int appendCapacity)
getAtback to summary
pack-priv byte getAt(int index)
isEmptyback to summary
pack-priv boolean isEmpty()
lengthback to summary
pack-priv int length()