APIdia Launch Partner
Top Fields Constructors Methods
jdk.internal.icu.impl

public final Class Trie2_16

extends Trie2
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer

Author
aheninger A read-only Trie2, holding 16 bit data values. A Trie2 is a highly optimized data structure for mapping from Unicode code points (values ranging from 0 to 0x10ffff) to a 16 or 32 bit value. See class Trie2 for descriptions of the API for accessing the contents of a trie. The fundamental data access methods are declared final in this class, with the intent that applications might gain a little extra performance, when compared with calling the same methods via the abstract UTrie2 base class.

Field Summary

Inherited from jdk.internal.icu.impl.Trie2:
data16data32dataLengthdataNullOffseterrorValueheaderhighStarthighValueIndexindexindex2NullOffsetindexLengthinitialValueUTRIE2_BAD_UTF8_DATA_OFFSETUTRIE2_DATA_BLOCK_LENGTHUTRIE2_DATA_GRANULARITYUTRIE2_DATA_MASKUTRIE2_INDEX_1_OFFSETUTRIE2_INDEX_2_BLOCK_LENGTHUTRIE2_INDEX_2_BMP_LENGTHUTRIE2_INDEX_2_MASKUTRIE2_INDEX_SHIFTUTRIE2_LSCP_INDEX_2_LENGTHUTRIE2_LSCP_INDEX_2_OFFSETUTRIE2_OMITTED_BMP_INDEX_1_LENGTHUTRIE2_OPTIONS_VALUE_BITS_MASKUTRIE2_SHIFT_1UTRIE2_SHIFT_1_2UTRIE2_SHIFT_2UTRIE2_UTF8_2B_INDEX_2_LENGTHUTRIE2_UTF8_2B_INDEX_2_OFFSET

Constructor Summary

AccessConstructor and Description
pack-priv
Trie2_16()

Internal constructor, not for general use.

Method Summary

Modifier and TypeMethod and Description
public static Trie2_16

Returns:

An unserialized Trie2_16, ready for use.
createFromSerialized
(ByteBuffer
a byte buffer to the serialized form of a UTrie2.
bytes
)

Hides jdk.internal.icu.impl.Trie2.createFromSerialized.

Create a Trie2 from its serialized form.

public final int

Returns:

the value
get
(int
the code point
codePoint
)

Implements abstract jdk.internal.icu.impl.Trie2.get.

Get the value for a code point as stored in the Trie2.

public int

Returns:

the value
getFromU16SingleLead
(char
a 16 bit code unit or lead surrogate value.
codeUnit
)

Implements abstract jdk.internal.icu.impl.Trie2.getFromU16SingleLead.

Get a Trie2 value for a UTF-16 code unit.

public int
getSerializedLength()

Returns: the number of bytes of the serialized trie

Inherited from jdk.internal.icu.impl.Trie2:
iteratoriteratorrangeEnd

Constructor Detail

Trie2_16back to summary
pack-priv Trie2_16()

Internal constructor, not for general use.

Method Detail

createFromSerializedback to summary
public static Trie2_16 createFromSerialized(ByteBuffer bytes) throws IOException

Hides jdk.internal.icu.impl.Trie2.createFromSerialized.

Create a Trie2 from its serialized form. Inverse of utrie2_serialize(). The serialized format is identical between ICU4C and ICU4J, so this function will work with serialized Trie2s from either. The serialized Trie2 in the bytes may be in either little or big endian byte order. This allows using serialized Tries from ICU4C without needing to consider the byte order of the system that created them.

Parameters
bytes:ByteBuffer

a byte buffer to the serialized form of a UTrie2.

Returns:Trie2_16

An unserialized Trie2_16, ready for use.

Exceptions
IOException:
if a read error occurs in the buffer.
IllegalArgumentException:
if the buffer does not contain a serialized Trie2.
ClassCastException:
if the bytes contain a serialized Trie2_32
getback to summary
public final int get(int codePoint)

Implements abstract jdk.internal.icu.impl.Trie2.get.

Get the value for a code point as stored in the Trie2.

Parameters
codePoint:int

the code point

Returns:int

the value

Annotations
@Override
getFromU16SingleLeadback to summary
public int getFromU16SingleLead(char codeUnit)

Implements abstract jdk.internal.icu.impl.Trie2.getFromU16SingleLead.

Get a Trie2 value for a UTF-16 code unit. This function returns the same value as get() if the input character is outside of the lead surrogate range There are two values stored in a Trie2 for inputs in the lead surrogate range. This function returns the alternate value, while Trie2.get() returns the main value.

Parameters
codeUnit:char

a 16 bit code unit or lead surrogate value.

Returns:int

the value

Annotations
@Override
getSerializedLengthback to summary
public int getSerializedLength()
Returns:int

the number of bytes of the serialized trie