|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.data.search.Trie
public class Trie
A trie data structure for fast-lookup of words based on their prefixes. The name "Trie" is a play on the words "tree" and "retrieval". This class builds a tree structure representing a set of words by their prefixes. It is useful for performing prefix-based searches over large amounts of text in an efficient manner.
PrefixSearchTupleSet
Nested Class Summary | |
---|---|
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 Summary | |
---|---|
Trie(boolean caseSensitive)
Create a new Trie with the specified case-sensitivity. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Trie(boolean caseSensitive)
caseSensitive
- true if the index should be case sensitive for
indexed words, false otherwise.Method Detail |
---|
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 lookup
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |