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 |
|---|
IntTrie(ByteBuffer bytes,
Trie.DataManipulate dataManipulate)
Creates a new Trie with the settings for the trie data.
|
IntTrie(int initialValue,
int leadUnitValue,
Trie.DataManipulate dataManipulate)
Make a dummy IntTrie.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Checks if the argument Trie has the same data as this Trie
|
int |
getBMPValue(char ch)
Get the value associated with the BMP code point.
|
int |
getCodePointValue(int ch)
Gets the value associated with the codepoint.
|
protected int |
getInitialValue()
Gets the default initial value
|
int |
getLatin1LinearValue(char ch)
Gets the latin 1 fast path value.
|
int |
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.
|
int |
getSurrogateValue(char lead,
char trail)
Get the value associated with a pair of surrogates.
|
int |
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 input stream and stores its trie content into a index and
data array
|
getBMPOffset, getCodePointOffset, getLeadOffset, getRawOffset, getSerializedDataSize, isCharTrie, isIntTrie, isLatin1Linearpublic IntTrie(ByteBuffer bytes, Trie.DataManipulate dataManipulate) throws IOException
Creates a new Trie with the settings for the trie data.
Unserialize the 32-bit-aligned input stream and use the data for the trie.
bytes - file buffer to a ICU data file, containing the triedataManipulate - object which provides methods to parse the char
dataIOException - thrown when data reading failspublic IntTrie(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 int getCodePointValue(int ch)
ch - codepointpublic final int getLeadValue(char ch)
ch - lead surrogate characterpublic final int getBMPValue(char ch)
ch - the input BMP code pointpublic final int getSurrogateValue(char lead,
char trail)
lead - a lead surrogatetrail - a trail surrogatepublic final int getTrailValue(int leadvalue,
char trail)
leadvalue - the value of a lead surrogate that contains the
folding offsettrail - surrogatepublic final int 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 input stream and stores its trie content into a index and data array
unserialize in class Triebytes - data 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