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.ibm.icu.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.ibm.icu.impl.Trie.DataManipulate are called to retrieve
that offset from the folded value for the lead surrogate unit.
For examples of use, see com.ibm.icu.impl.CharTrie or
com.ibm.icu.impl.IntTrie.
author: synwee See Also: com.ibm.icu.impl.CharTrie See Also: com.ibm.icu.impl.IntTrie since: release 2.1, Jan 01 2002 |