| Modifier and Type | Class and Description |
|---|---|
| public static class | Trie2.
When iterating over the contents of a Trie2, Elements of this type are produced. |
| pack-priv class | Trie2.
Implementation class for an iterator over a Trie2. |
| pack-priv static class | Trie2.
Trie2 data structure in serialized form: UTrie2Header header; uint16_t index[header.index2Length]; uint16_t data[header.shiftedDataLength<<2]; -- or uint32_t data[...] For Java, this is read from the stream into an instance of UTrie2Header. |
| public static interface | Trie2.
When iterating over the contents of a Trie2, an instance of TrieValueMapper may be used to remap the values from the Trie2. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv int[] | |
| pack-priv int | |
| pack-priv int | |
| private static Trie2. | |
| pack-priv int | errorValue
Value returned for out-of-range code points and illegal UTF-8. |
| pack-priv Trie2. | |
| pack-priv int | |
| pack-priv int | |
| pack-priv char[] | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv static final int | UTRIE2_BAD_UTF8_DATA_OFFSET
The illegal-UTF-8 data block follows the ASCII block, at offset 128=0x80. |
| pack-priv static final int | UTRIE2_DATA_BLOCK_LENGTH
Number of entries in a data block. |
| pack-priv static final int | UTRIE2_DATA_GRANULARITY
The alignment size of a data block. |
| pack-priv static final int | UTRIE2_DATA_MASK
Mask for getting the lower bits for the in-data-block offset. |
| pack-priv static final int | UTRIE2_INDEX_1_OFFSET
The index-1 table, only used for supplementary code points, at offset 2112=0x840. |
| pack-priv static final int | UTRIE2_INDEX_2_BLOCK_LENGTH
Number of entries in an index-2 block. |
| pack-priv static final int | UTRIE2_INDEX_2_BMP_LENGTH
Count the lengths of both BMP pieces. |
| pack-priv static final int | UTRIE2_INDEX_2_MASK
Mask for getting the lower bits for the in-index-2-block offset. |
| pack-priv static final int | UTRIE2_INDEX_SHIFT
Shift size for shifting left the index array values. |
| pack-priv static final int | |
| pack-priv static final int | UTRIE2_LSCP_INDEX_2_OFFSET
The part of the index-2 table for U+D800..U+DBFF stores values for lead surrogate code _units_ not code _points_. |
| pack-priv static final int | UTRIE2_OMITTED_BMP_INDEX_1_LENGTH
Number of index-1 entries for the BMP. |
| pack-priv static final int | UTRIE2_OPTIONS_VALUE_BITS_MASK
Trie2 constants, defining shift widths, index array lengths, etc. These are needed for the runtime macros but users can treat these as implementation details and skip to the actual public API further below. |
| pack-priv static final int | UTRIE2_SHIFT_1
Shift size for getting the index-1 table offset. |
| pack-priv static final int | UTRIE2_SHIFT_1_2
Difference between the two shift sizes, for getting an index-1 offset from an index-2 offset. |
| pack-priv static final int | UTRIE2_SHIFT_2
Shift size for getting the index-2 table offset. |
| pack-priv static final int | |
| pack-priv static final int | UTRIE2_UTF8_2B_INDEX_2_OFFSET
The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public static Trie2 | Returns: An unserialized Trie2, ready for use.a byte buffer to the serialized form of a UTrie2. bytes)Create a Trie2 from its serialized form. |
| public abstract int | Returns: the valuethe code point codePoint)Get the value for a code point as stored in the Trie2. |
| public abstract int | Returns: the valuethe code point or lead surrogate value. c)Get the trie value for a UTF-16 code unit. |
| private static int | |
| private static int | |
| private static int | |
| private static int | |
| public Iterator | Returns: an IteratorImplements java. Create an iterator over the value ranges in this Trie2. |
| public Iterator | Returns: an Iteratorprovides a function to remap values obtained from the Trie2. mapperCreate an iterator over the value ranges from this Trie2. |
| pack-priv int | Returns: The last contiguous character with the same value.Find the last character in a contiguous range of characters with the same Trie2 value as the input character. |
| data16 | back to summary |
|---|---|
| pack-priv int data16 | |
| data32 | back to summary |
|---|---|
| pack-priv int[] data32 | |
| dataLength | back to summary |
|---|---|
| pack-priv int dataLength | |
| dataNullOffset | back to summary |
|---|---|
| pack-priv int dataNullOffset | |
| defaultValueMapper | back to summary |
|---|---|
| private static Trie2. | |
| errorValue | back to summary |
|---|---|
| pack-priv int errorValue Value returned for out-of-range code points and illegal UTF-8. | |
| header | back to summary |
|---|---|
| pack-priv Trie2. | |
| highStart | back to summary |
|---|---|
| pack-priv int highStart | |
| highValueIndex | back to summary |
|---|---|
| pack-priv int highValueIndex | |
| index | back to summary |
|---|---|
| pack-priv char[] index | |
| index2NullOffset | back to summary |
|---|---|
| pack-priv int index2NullOffset | |
| indexLength | back to summary |
|---|---|
| pack-priv int indexLength | |
| initialValue | back to summary |
|---|---|
| pack-priv int initialValue | |
| UTRIE2_BAD_UTF8_DATA_OFFSET | back to summary |
|---|---|
| pack-priv static final int UTRIE2_BAD_UTF8_DATA_OFFSET The illegal-UTF-8 data block follows the ASCII block, at offset 128=0x80. Used with linear access for single bytes 0..0xbf for simple error handling. Length 64=0x40, not UTRIE2_DATA_BLOCK_LENGTH. | |
| UTRIE2_DATA_BLOCK_LENGTH | back to summary |
|---|---|
| pack-priv static final int UTRIE2_DATA_BLOCK_LENGTH Number of entries in a data block. 32=0x20 | |
| UTRIE2_DATA_GRANULARITY | back to summary |
|---|---|
| pack-priv static final int UTRIE2_DATA_GRANULARITY The alignment size of a data block. Also the granularity for compaction. | |
| UTRIE2_DATA_MASK | back to summary |
|---|---|
| pack-priv static final int UTRIE2_DATA_MASK Mask for getting the lower bits for the in-data-block offset. | |
| UTRIE2_INDEX_1_OFFSET | back to summary |
|---|---|
| pack-priv static final int UTRIE2_INDEX_1_OFFSET The index-1 table, only used for supplementary code points, at offset 2112=0x840. Variable length, for code points up to highStart, where the last single-value range starts. Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1. (For 0x100000 supplementary code points U+10000..U+10ffff.) The part of the index-2 table for supplementary code points starts after this index-1 table. Both the index-1 table and the following part of the index-2 table are omitted completely if there is only BMP data. | |
| UTRIE2_INDEX_2_BLOCK_LENGTH | back to summary |
|---|---|
| pack-priv static final int UTRIE2_INDEX_2_BLOCK_LENGTH Number of entries in an index-2 block. 64=0x40 | |
| UTRIE2_INDEX_2_BMP_LENGTH | back to summary |
|---|---|
| pack-priv static final int UTRIE2_INDEX_2_BMP_LENGTH Count the lengths of both BMP pieces. 2080=0x820 | |
| UTRIE2_INDEX_2_MASK | back to summary |
|---|---|
| pack-priv static final int UTRIE2_INDEX_2_MASK Mask for getting the lower bits for the in-index-2-block offset. | |
| UTRIE2_INDEX_SHIFT | back to summary |
|---|---|
| pack-priv static final int UTRIE2_INDEX_SHIFT Shift size for shifting left the index array values. Increases possible data size with 16-bit index values at the cost of compactability. This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY. | |
| UTRIE2_LSCP_INDEX_2_LENGTH | back to summary |
|---|---|
| pack-priv static final int UTRIE2_LSCP_INDEX_2_LENGTH | |
| UTRIE2_LSCP_INDEX_2_OFFSET | back to summary |
|---|---|
| pack-priv static final int UTRIE2_LSCP_INDEX_2_OFFSET The part of the index-2 table for U+D800..U+DBFF stores values for lead surrogate code _units_ not code _points_. Values for lead surrogate code _points_ are indexed with this portion of the table. Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.) | |
| UTRIE2_OMITTED_BMP_INDEX_1_LENGTH | back to summary |
|---|---|
| pack-priv static final int UTRIE2_OMITTED_BMP_INDEX_1_LENGTH Number of index-1 entries for the BMP. 32=0x20 This part of the index-1 table is omitted from the serialized form. | |
| UTRIE2_OPTIONS_VALUE_BITS_MASK | back to summary |
|---|---|
| pack-priv static final int UTRIE2_OPTIONS_VALUE_BITS_MASK Trie2 constants, defining shift widths, index array lengths, etc. These are needed for the runtime macros but users can treat these as implementation details and skip to the actual public API further below. | |
| UTRIE2_SHIFT_1 | back to summary |
|---|---|
| pack-priv static final int UTRIE2_SHIFT_1 Shift size for getting the index-1 table offset. | |
| UTRIE2_SHIFT_1_2 | back to summary |
|---|---|
| pack-priv static final int UTRIE2_SHIFT_1_2 Difference between the two shift sizes, for getting an index-1 offset from an index-2 offset. 6=11-5 | |
| UTRIE2_SHIFT_2 | back to summary |
|---|---|
| pack-priv static final int UTRIE2_SHIFT_2 Shift size for getting the index-2 table offset. | |
| UTRIE2_UTF8_2B_INDEX_2_LENGTH | back to summary |
|---|---|
| pack-priv static final int UTRIE2_UTF8_2B_INDEX_2_LENGTH | |
| UTRIE2_UTF8_2B_INDEX_2_OFFSET | back to summary |
|---|---|
| pack-priv static final int UTRIE2_UTF8_2B_INDEX_2_OFFSET The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820. Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2. | |
| Trie2 | back to summary |
|---|---|
| pack-priv Trie2() | |
| createFromSerialized | back to summary |
|---|---|
| public static Trie2 createFromSerialized(ByteBuffer bytes) throws IOException Create a Trie2 from its serialized form. Inverse of utrie2_serialize(). Reads from the current position and leaves the buffer after the end of the trie. The serialized format is identical between ICU4C and ICU4J, so this function will work with serialized Trie2s from either. The actual type of the returned Trie2 will be either Trie2_16 or Trie2_32, depending on the width of the data. To obtain the width of the Trie2, check the actual class type of the returned Trie2. Or use the createFromSerialized() function of Trie2_16 or Trie2_32, which will return only Tries of their specific type/size. The serialized Trie2 on the stream 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.
| |
| get | back to summary |
|---|---|
| public abstract int get(int codePoint) Get the value for a code point as stored in the Trie2.
| |
| getFromU16SingleLead | back to summary |
|---|---|
| public abstract int getFromU16SingleLead(char c) Get the trie value for a UTF-16 code unit. A Trie2 stores two distinct values for input in the lead surrogate range, one for lead surrogates, which is the value that will be returned by this function, and a second value that is returned by Trie2.get(). For code units outside of the lead surrogate range, this function returns the same result as Trie2.get(). This function, together with the alternate value for lead surrogates, makes possible very efficient processing of UTF-16 strings without first converting surrogate pairs to their corresponding 32 bit code point values. At build-time, enumerate the contents of the Trie2 to see if there is non-trivial (non-initialValue) data for any of the supplementary code points associated with a lead surrogate. If so, then set a special (application-specific) value for the lead surrogate code _unit_, with Trie2Writable.setForLeadSurrogateCodeUnit(). At runtime, use Trie2.getFromU16SingleLead(). If there is non-trivial data and the code unit is a lead surrogate, then check if a trail surrogate follows. If so, assemble the supplementary code point and look up its value with Trie2.get(); otherwise reset the lead surrogate's value or do a code point lookup for it. If there is only trivial data for lead and trail surrogates, then processing can often skip them. For example, in normalization or case mapping all characters that do not have any mappings are simply copied as is.
| |
| hashByte | back to summary |
|---|---|
| private static int hashByte(int h, int b) | |
| hashInt | back to summary |
|---|---|
| private static int hashInt(int h, int i) | |
| hashUChar32 | back to summary |
|---|---|
| private static int hashUChar32(int h, int c) | |
| initHash | back to summary |
|---|---|
| private static int initHash() | |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Create an iterator over the value ranges in this Trie2. Values from the Trie2 are not remapped or filtered, but are returned as they are stored in the Trie2. | |
| iterator | back to summary |
|---|---|
| public Iterator Create an iterator over the value ranges from this Trie2. Values from the Trie2 are passed through a caller-supplied remapping function, and it is the remapped values that determine the ranges that will be produced by the iterator.
| |
| rangeEnd | back to summary |
|---|---|
| pack-priv int rangeEnd(int start, int limitp, int val) Find the last character in a contiguous range of characters with the same Trie2 value as the input character.
| |
| Modifier and Type | Field and Description |
|---|---|
| public int | |
| public boolean | |
| public int | |
| public int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object other)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public int |
| endCodePoint | back to summary |
|---|---|
| public int endCodePoint | |
| leadSurrogate | back to summary |
|---|---|
| public boolean leadSurrogate | |
| startCodePoint | back to summary |
|---|---|
| public int startCodePoint | |
| value | back to summary |
|---|---|
| public int value | |
| Range | back to summary |
|---|---|
| public Range() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean | |
| private int | |
| private Trie2. | |
| private int | |
| private Trie2. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public Trie2. | |
| private int |
| doingCodePoints | back to summary |
|---|---|
| private boolean doingCodePoints | |
| doLeadSurrogates | back to summary |
|---|---|
| private boolean doLeadSurrogates | |
| limitCP | back to summary |
|---|---|
| private int limitCP | |
| mapper | back to summary |
|---|---|
| private Trie2. | |
| nextStart | back to summary |
|---|---|
| private int nextStart | |
| returnValue | back to summary |
|---|---|
| private Trie2. | |
| Trie2Iterator | back to summary |
|---|---|
| pack-priv Trie2Iterator(Trie2. | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns | |
| next | back to summary |
|---|---|
| public Trie2. Implements java. The main next() function for Trie2 iterators | |
| rangeEndLS | back to summary |
|---|---|
| private int rangeEndLS(char startingLS) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | dataNullOffset
Null index and data blocks, not shifted. |
| pack-priv int | index2NullOffset
Null index and data blocks, not shifted. |
| pack-priv int | indexLength
UTRIE2_INDEX_1_OFFSET..UTRIE2_MAX_INDEX_LENGTH (uint16_t) |
| pack-priv int | options
options bit field (uint16_t): 15.. |
| pack-priv int | shiftedDataLength
(UTRIE2_DATA_START_OFFSET..UTRIE2_MAX_DATA_LENGTH)>>UTRIE2_INDEX_SHIFT (uint16_t) |
| pack-priv int | shiftedHighStart
First code point of the single-value range ending with U+10ffff, rounded up and then shifted right by UTRIE2_SHIFT_1. |
| pack-priv int | signature
"Tri2" in big-endian US-ASCII (0x54726932) |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| dataNullOffset | back to summary |
|---|---|
| pack-priv int dataNullOffset Null index and data blocks, not shifted. (uint16_t) | |
| index2NullOffset | back to summary |
|---|---|
| pack-priv int index2NullOffset Null index and data blocks, not shifted. (uint16_t) | |
| indexLength | back to summary |
|---|---|
| pack-priv int indexLength UTRIE2_INDEX_1_OFFSET..UTRIE2_MAX_INDEX_LENGTH (uint16_t) | |
| options | back to summary |
|---|---|
| pack-priv int options options bit field (uint16_t): 15.. 4 reserved (0) 3.. 0 UTrie2ValueBits valueBits | |
| shiftedDataLength | back to summary |
|---|---|
| pack-priv int shiftedDataLength (UTRIE2_DATA_START_OFFSET..UTRIE2_MAX_DATA_LENGTH)>>UTRIE2_INDEX_SHIFT (uint16_t) | |
| shiftedHighStart | back to summary |
|---|---|
| pack-priv int shiftedHighStart First code point of the single-value range ending with U+10ffff, rounded up and then shifted right by UTRIE2_SHIFT_1. (uint16_t) | |
| signature | back to summary |
|---|---|
| pack-priv int signature "Tri2" in big-endian US-ASCII (0x54726932) | |
| UTrie2Header | back to summary |
|---|---|
| pack-priv UTrie2Header() | |
| Modifier and Type | Method and Description |
|---|---|
| public int |
| map | back to summary |
|---|---|
| public int map(int originalVal) | |