Package com.ibm.icu.impl
Class TextTrieMap<V>
java.lang.Object
com.ibm.icu.impl.TextTrieMap<V>
TextTrieMap is a trie implementation for supporting
fast prefix match for the key.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static classprivate classInner class representing a text node in the trie.static classstatic interfaceCallback handler for processing prefix matches used by find method. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidfind(TextTrieMap<V>.Node node, TextTrieMap.CharIterator chitr, TextTrieMap.ResultHandler<V> handler, TextTrieMap.Output output) voidfind(CharSequence text, int offset, TextTrieMap.ResultHandler<V> handler) private voidfind(CharSequence text, int offset, TextTrieMap.ResultHandler<V> handler, TextTrieMap.Output output) voidfind(CharSequence text, TextTrieMap.ResultHandler<V> handler) get(CharSequence text, int start) Gets an iterator of the objects associated with the longest prefix matching string key starting at the specified position.get(CharSequence text, int start, TextTrieMap.Output output) Gets an iterator of the objects associated with the longest prefix matching string key.put(CharSequence text, V val) Adds the text key and its associated object in this object.voidputLeadCodePoints(UnicodeSet output) private static char[]subArray(char[] array, int start) private static char[]subArray(char[] array, int start, int limit) private static char[]toCharArray(CharSequence text)
-
Field Details
-
_root
-
_ignoreCase
boolean _ignoreCase
-
-
Constructor Details
-
TextTrieMap
public TextTrieMap(boolean ignoreCase) Constructs a TextTrieMap object.- Parameters:
ignoreCase- true to use simple case insensitive match
-
-
Method Details
-
put
Adds the text key and its associated object in this object.- Parameters:
text- The text.val- The value object associated with the text.
-
get
Gets an iterator of the objects associated with the longest prefix matching string key.- Parameters:
text- The text to be matched with prefixes.- Returns:
- An iterator of the objects associated with the longest prefix matching matching key, or null if no matching entry is found.
-
get
Gets an iterator of the objects associated with the longest prefix matching string key starting at the specified position.- Parameters:
text- The text to be matched with prefixes.start- The start index of of the text- Returns:
- An iterator of the objects associated with the longest prefix matching matching key, or null if no matching entry is found.
-
get
-
find
-
find
-
find
private void find(CharSequence text, int offset, TextTrieMap.ResultHandler<V> handler, TextTrieMap.Output output) -
find
private void find(TextTrieMap<V>.Node node, TextTrieMap.CharIterator chitr, TextTrieMap.ResultHandler<V> handler, TextTrieMap.Output output) -
putLeadCodePoints
-
toCharArray
-
subArray
private static char[] subArray(char[] array, int start) -
subArray
private static char[] subArray(char[] array, int start, int limit)
-