Trie.DataManipulateBMP_INDEX_LENGTH, DATA_BLOCK_LENGTH, HEADER_LENGTH_, HEADER_OPTIONS_DATA_IS_32_BIT_, HEADER_OPTIONS_INDEX_SHIFT_, HEADER_OPTIONS_LATIN1_IS_LINEAR_MASK_, HEADER_SIGNATURE_, INDEX_STAGE_1_SHIFT_, INDEX_STAGE_2_SHIFT_, INDEX_STAGE_3_MASK_, LEAD_INDEX_OFFSET_, m_dataLength_, m_dataManipulate_, m_dataOffset_, m_index_, SURROGATE_BLOCK_BITS, SURROGATE_BLOCK_COUNT, SURROGATE_MASK_| Constructor and Description |
|---|
CharTrie(ByteBuffer bytes,
Trie.DataManipulate dataManipulate)
Creates a new Trie with the settings for the trie data.
|
CharTrie(int initialValue,
int leadUnitValue,
Trie.DataManipulate dataManipulate)
Make a dummy CharTrie.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Checks if the argument Trie has the same data as this Trie
|
char |
getBMPValue(char ch)
Get the value associated with the BMP code point.
|
char |
getCodePointValue(int ch)
Gets the value associated with the codepoint.
|
protected int |
getInitialValue()
Gets the default initial value
|
char |
getLatin1LinearValue(char ch)
Gets the latin 1 fast path value.
|
char |
getLeadValue(char ch)
Gets the value to the data which this lead surrogate character points
to.
|
protected int |
getSurrogateOffset(char lead,
char trail)
Gets the offset to the data which the surrogate pair points to.
|
char |
getSurrogateValue(char lead,
char trail)
Get the value associated with a pair of surrogates.
|
char |
getTrailValue(int leadvalue,
char trail)
Get a value from a folding offset (from the value of a lead surrogate)
and a trail surrogate.
|
protected int |
getValue(int index)
Gets the value at the argument index.
|
int |
hashCode()
Returns an integer hash code for this object.
|
protected void |
unserialize(ByteBuffer bytes)
Parses the byte buffer and stores its trie content into a index and
data array
|
getBMPOffset, getCodePointOffset, getLeadOffset, getRawOffset, getSerializedDataSize, isCharTrie, isIntTrie, isLatin1Linearpublic CharTrie(ByteBuffer bytes, Trie.DataManipulate dataManipulate)
Creates a new Trie with the settings for the trie data.
Unserialize the 32-bit-aligned input buffer and use the data for the trie.
bytes - data of an ICU data file, containing the triedataManipulate - object which provides methods to parse the char
datapublic CharTrie(int initialValue,
int leadUnitValue,
Trie.DataManipulate dataManipulate)
initialValue - the initial value that is set for all code pointsleadUnitValue - the value for lead surrogate code _units_ that do not
have associated supplementary datadataManipulate - object which provides methods to parse the char datapublic final char getCodePointValue(int ch)
ch - codepointpublic final char getLeadValue(char ch)
ch - lead surrogate characterpublic final char getBMPValue(char ch)
ch - the input BMP code pointpublic final char getSurrogateValue(char lead,
char trail)
lead - a lead surrogatetrail - a trail surrogatepublic final char getTrailValue(int leadvalue,
char trail)
Get a value from a folding offset (from the value of a lead surrogate) and a trail surrogate.
If the
leadvalue - value associated with the lead surrogate which contains
the folding offsettrail - surrogatepublic final char getLatin1LinearValue(char ch)
Gets the latin 1 fast path value.
Note this only works if latin 1 characters have their own linear array.
ch - latin 1 characterspublic boolean equals(Object other)
equals in class Trieother - Trie to checkObject.hashCode()public int hashCode()
ObjectObject.equals(java.lang.Object) returns true must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode method
if you intend implementing your own hashCode method.
hashCode in class TrieObject.equals(java.lang.Object)protected final void unserialize(ByteBuffer bytes)
Parses the byte buffer and stores its trie content into a index and data array
unserialize in class Triebytes - buffer containing trie dataprotected final int getSurrogateOffset(char lead,
char trail)
getSurrogateOffset in class Trielead - lead surrogatetrail - trailing surrogateprotected final int getValue(int index)
getValue in class Trieindex - value at index will be retrievedTrieIteratorprotected final int getInitialValue()
getInitialValue in class Trie