|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.util.TrieSet
A TrieSet. A set-like interface designed specifically for Strings. Uses a Trie as the backing Map, and provides an implementation specific to Strings. Has the same retrieval/insertion times as the backing Trie. Stores the value as the string, for easier retrieval. The goal is to efficiently find Strings that can branch off a prefix. Primarily designed as an AutoCompleteDictionary
Constructor Summary | |
TrieSet(boolean caseSensitive)
This constuctor sets up a dictionary where case IS significant but whose sort order is binary based. |
Method Summary | |
void |
addEntry(java.lang.String data)
Adds a value to the set. |
boolean |
contains(java.lang.String data)
Determines whether or not the Set contains this String. |
java.util.Iterator |
getPrefixedBy(java.lang.String data)
Return all the Strings that can be prefixed by this String. |
java.lang.String |
lookup(java.lang.String data)
Return the last String in the set that can be prefixed by this String (Trie's are stored in alphabetical order). |
boolean |
removeEntry(java.lang.String data)
Removes a value from the Set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TrieSet(boolean caseSensitive)
Method Detail |
public void addEntry(java.lang.String data)
addEntry
in interface AutoCompleteDictionary
data
- The string to add to the dictionary.public boolean contains(java.lang.String data)
public boolean removeEntry(java.lang.String data)
removeEntry
in interface AutoCompleteDictionary
data
- The string to remove to the dictionary.
public java.util.Iterator getPrefixedBy(java.lang.String data)
public java.lang.String lookup(java.lang.String data)
lookup
in interface AutoCompleteDictionary
data
- The string to use as the base for the lookup. How this routine
is implemented determines the behaviour of the component.
Typically, the closest matching string that completely contains
the given string is returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |