public class Trie
extends java.lang.Object
PrefixSearchTupleSet
Modifier and Type | Class and Description |
---|---|
class |
Trie.TrieBranch
A TrieNode implementation representing a branch in the tree.
|
class |
Trie.TrieIterator
An iterator for traversing a subtree of the Trie.
|
class |
Trie.TrieLeaf
A TrieNode implementation representing a leaf in the tree.
|
class |
Trie.TrieNode
Base class for nodes in the trie structure.
|
Constructor and Description |
---|
Trie(boolean caseSensitive)
Create a new Trie with the specified case-sensitivity.
|
Modifier and Type | Method and Description |
---|---|
void |
addString(java.lang.String word,
Tuple t)
Add a new word to the trie, associated with the given Tuple.
|
Trie.TrieNode |
find(java.lang.String word)
Look up the given word in this Trie.
|
boolean |
isCaseSensitive()
Indicates if this Trie's index takes the case of letters
into account.
|
void |
removeString(java.lang.String word,
Tuple t)
Remove a word/Tuple pair from the trie.
|
public Trie(boolean caseSensitive)
caseSensitive
- true if the index should be case sensitive for
indexed words, false otherwise.public boolean isCaseSensitive()
public void addString(java.lang.String word, Tuple t)
word
- the word to add to the Triet
- the Tuple associated with the wordpublic void removeString(java.lang.String word, Tuple t)
word
- the word to removet
- the associate Tuple to removepublic Trie.TrieNode find(java.lang.String word)
word
- the word to lookupCopyright ? 2013 Regents of the University of California