public abstract class Trie extends Object
A trie is a kind of compressed, serializable table of values associated with Unicode code points (0..0x10ffff).
This class defines the basic structure of a trie and provides methods to retrieve the offsets to the actual data.
Data will be the form of an array of basic types, char or int.
The actual data format will have to be specified by the user in the inner static interface com.adobe.agl.impl.Trie.DataManipulate.
This trie implementation is optimized for getting offset while walking forward through a UTF-16 string. Therefore, the simplest and fastest access macros are the fromLead() and fromOffsetTrail() methods. The fromBMP() method are a little more complicated; they get offsets even for lead surrogate codepoints, while the fromLead() method get special "folded" offsets for lead surrogate code units if there is relevant data associated with them. From such a folded offsets, an offset needs to be extracted to supply to the fromOffsetTrail() methods. To handle such supplementary codepoints, some offset information are kept in the data.
Methods in com.adobe.agl.impl.Trie.DataManipulate are called to retrieve that offset from the folded value for the lead surrogate unit.
For examples of use, see com.adobe.agl.impl.CharTrie or com.adobe.agl.impl.IntTrie.
CharTrie,
IntTrie| Modifier and Type | Class and Description |
|---|---|
static interface |
Trie.DataManipulate
Character data in com.ibm.impl.Trie have different user-specified format
for different purposes.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Checks if the argument Trie has the same data as this Trie.
|
int |
getSerializedDataSize()
Gets the serialized data file size of the Trie.
|
boolean |
isLatin1Linear()
Determines if this trie has a linear latin 1 array
|
public final boolean isLatin1Linear()
public boolean equals(Object other)
public int getSerializedDataSize()
Copyright © 2010 - 2020 Adobe. All Rights Reserved