Package com.ibm.icu.impl
Class TextTrieMap<V>
- java.lang.Object
-
- com.ibm.icu.impl.TextTrieMap<V>
-
public class TextTrieMap<V> extends java.lang.Object
TextTrieMap is a trie implementation for supporting fast prefix match for the key.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TextTrieMap.CharIterator
private static class
TextTrieMap.LongestMatchHandler<V>
private class
TextTrieMap.Node
Inner class representing a text node in the trie.static class
TextTrieMap.Output
static interface
TextTrieMap.ResultHandler<V>
Callback handler for processing prefix matches used by find method.
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
_ignoreCase
private TextTrieMap.Node
_root
-
Constructor Summary
Constructors Constructor Description TextTrieMap(boolean ignoreCase)
Constructs a TextTrieMap object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
find(TextTrieMap.Node node, TextTrieMap.CharIterator chitr, TextTrieMap.ResultHandler<V> handler, TextTrieMap.Output output)
void
find(java.lang.CharSequence text, int offset, TextTrieMap.ResultHandler<V> handler)
private void
find(java.lang.CharSequence text, int offset, TextTrieMap.ResultHandler<V> handler, TextTrieMap.Output output)
void
find(java.lang.CharSequence text, TextTrieMap.ResultHandler<V> handler)
java.util.Iterator<V>
get(java.lang.CharSequence text, int start)
Gets an iterator of the objects associated with the longest prefix matching string key starting at the specified position.java.util.Iterator<V>
get(java.lang.CharSequence text, int start, TextTrieMap.Output output)
java.util.Iterator<V>
get(java.lang.String text)
Gets an iterator of the objects associated with the longest prefix matching string key.TextTrieMap<V>
put(java.lang.CharSequence text, V val)
Adds the text key and its associated object in this object.void
putLeadCodePoints(UnicodeSet output)
private static char[]
subArray(char[] array, int start)
private static char[]
subArray(char[] array, int start, int limit)
private static char[]
toCharArray(java.lang.CharSequence text)
-
-
-
Field Detail
-
_root
private TextTrieMap.Node _root
-
_ignoreCase
boolean _ignoreCase
-
-
Method Detail
-
put
public TextTrieMap<V> put(java.lang.CharSequence text, V val)
Adds the text key and its associated object in this object.- Parameters:
text
- The text.val
- The value object associated with the text.
-
get
public java.util.Iterator<V> get(java.lang.String text)
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
public java.util.Iterator<V> get(java.lang.CharSequence text, int start)
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
public java.util.Iterator<V> get(java.lang.CharSequence text, int start, TextTrieMap.Output output)
-
find
public void find(java.lang.CharSequence text, TextTrieMap.ResultHandler<V> handler)
-
find
public void find(java.lang.CharSequence text, int offset, TextTrieMap.ResultHandler<V> handler)
-
find
private void find(java.lang.CharSequence text, int offset, TextTrieMap.ResultHandler<V> handler, TextTrieMap.Output output)
-
find
private void find(TextTrieMap.Node node, TextTrieMap.CharIterator chitr, TextTrieMap.ResultHandler<V> handler, TextTrieMap.Output output)
-
putLeadCodePoints
public void putLeadCodePoints(UnicodeSet output)
-
toCharArray
private static char[] toCharArray(java.lang.CharSequence text)
-
subArray
private static char[] subArray(char[] array, int start)
-
subArray
private static char[] subArray(char[] array, int start, int limit)
-
-