Top Description Fields Constructors Methods
jdk.internal.icu.impl

public Class CharTrie

extends Trie
Class Inheritance
Imports
jdk.internal.icu.text.UTF16, java.io.DataInputStream, .InputStream, .IOException

Trie implementation which stores data in char, 16 bits.
Author
synwee
Since
release 2.1, Jan 01 2002
See Also
com.ibm.icu.impl.Trie

Field Summary

Modifier and TypeField and Description
private char[]
m_data_

Array of char data

private char
m_initialValue_

Default value

Inherited from jdk.internal.icu.impl.Trie:
DATA_BLOCK_LENGTHHEADER_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_MASK_

Constructor Summary

AccessConstructor and Description
public
CharTrie(InputStream
file input stream to a ICU data file, containing the trie
inputStream
,
Trie.DataManipulate
object which provides methods to parse the char data
dataManipulate
)

Creates a new Trie with the settings for the trie data.

Method Summary

Modifier and TypeMethod and Description
public final char

Returns:

offset to data
getCodePointValue
(int
codepoint
ch
)

Gets the value associated with the codepoint.

public final char

Returns:

data value
getLeadValue
(char
lead surrogate character
ch
)

Gets the value to the data which this lead surrogate character points to.

protected final int

Returns:

offset to data
getSurrogateOffset
(char
lead surrogate
lead
,
char
trailing surrogate
trail
)

Implements abstract jdk.internal.icu.impl.Trie.getSurrogateOffset.

Gets the offset to the data which the surrogate pair points to.
protected final void
unserialize(InputStream
data input stream containing trie data
inputStream
)

Overrides jdk.internal.icu.impl.Trie.unserialize.

Parses the input stream and stores its trie content into a index and data array

Inherited from jdk.internal.icu.impl.Trie:
getBMPOffsetgetCodePointOffsetgetLeadOffsetgetRawOffsetisCharTrie

Field Detail

m_data_back to summary
private char[] m_data_

Array of char data

m_initialValue_back to summary
private char m_initialValue_

Default value

Constructor Detail

CharTrieback to summary
public CharTrie(InputStream inputStream, 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.

Parameters
inputStream:InputStream

file input stream to a ICU data file, containing the trie

dataManipulate:Trie.DataManipulate

object which provides methods to parse the char data

Exceptions
IOException:
thrown when data reading fails
ICU Status
Draft since ICU 2.1.

Method Detail

getCodePointValueback to summary
public final char getCodePointValue(int ch)

Gets the value associated with the codepoint. If no value is associated with the codepoint, a default value will be returned.

Parameters
ch:int

codepoint

Returns:char

offset to data

getLeadValueback to summary
public final char getLeadValue(char ch)

Gets the value to the data which this lead surrogate character points to. Returned data may contain folding offset information for the next trailing surrogate character. This method does not guarantee correct results for trail surrogates.

Parameters
ch:char

lead surrogate character

Returns:char

data value

getSurrogateOffsetback to summary
protected final int getSurrogateOffset(char lead, char trail)

Implements abstract jdk.internal.icu.impl.Trie.getSurrogateOffset.

Gets the offset to the data which the surrogate pair points to.

Parameters
lead:char

lead surrogate

trail:char

trailing surrogate

Returns:int

offset to data

ICU Status
Draft since ICU 2.1.
unserializeback to summary
protected final void unserialize(InputStream inputStream) throws IOException

Overrides jdk.internal.icu.impl.Trie.unserialize.

Parses the input stream and stores its trie content into a index and data array

Parameters
inputStream:InputStream

data input stream containing trie data

Exceptions
IOException:
thrown when data reading fails