Package com.ibm.icu.impl
Class TextTrieMap<V>
- java.lang.Object
-
- com.ibm.icu.impl.TextTrieMap<V>
-
public class TextTrieMap<V> extends 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 classTextTrieMap.CharIteratorstatic interfaceTextTrieMap.ResultHandler<V>Callback handler for processing prefix matches used by find method.
-
Constructor Summary
Constructors Constructor Description TextTrieMap(boolean ignoreCase)Constructs a TextTrieMap object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfind(CharSequence text, int offset, TextTrieMap.ResultHandler<V> handler)voidfind(CharSequence text, TextTrieMap.ResultHandler<V> handler)Iterator<V>get(CharSequence text, int start)Gets an iterator of the objects associated with the longest prefix matching string key starting at the specified position.Iterator<V>get(CharSequence text, int start, int[] matchLen)Iterator<V>get(String text)Gets an iterator of the objects associated with the longest prefix matching string key.TextTrieMap<V>put(CharSequence text, V val)Adds the text key and its associated object in this object.
-
-
-
Method Detail
-
put
public TextTrieMap<V> put(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 Iterator<V> get(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 Iterator<V> get(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 Iterator<V> get(CharSequence text, int start, int[] matchLen)
-
find
public void find(CharSequence text, TextTrieMap.ResultHandler<V> handler)
-
find
public void find(CharSequence text, int offset, TextTrieMap.ResultHandler<V> handler)
-
-