|
LimeWire collection component api | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.limewire.collection.StringTrieSet
public class StringTrieSet
Provides 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.
See Trie for more information.
| Constructor Summary | |
|---|---|
StringTrieSet(boolean ignoreCase)
|
|
| Method Summary | |
|---|---|
void |
addEntry(java.lang.String data)
Adds a value to the set. |
void |
clear()
Clears all items in the dictionary. |
boolean |
contains(java.lang.String data)
Determines whether or not the Set contains this String. |
java.util.Collection<java.lang.String> |
getPrefixedBy(java.lang.String data)
Return all the Strings that can be prefixed by this String. |
boolean |
isImmediate()
Returns true if the dictionary can immediately return results. |
java.util.Iterator<java.lang.String> |
iterator()
Returns all values (entire TrieSet). |
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 StringTrieSet(boolean ignoreCase)
| Method Detail |
|---|
public boolean isImmediate()
AutoCompleteDictionary
isImmediate in interface AutoCompleteDictionarypublic void addEntry(java.lang.String data)
addEntry in interface AutoCompleteDictionarydata - The string to add to the dictionary.public boolean contains(java.lang.String data)
public boolean removeEntry(java.lang.String data)
removeEntry in interface AutoCompleteDictionarydata - The string to remove to the dictionary.
public java.util.Collection<java.lang.String> getPrefixedBy(java.lang.String data)
getPrefixedBy in interface AutoCompleteDictionarypublic java.lang.String lookup(java.lang.String data)
lookup in interface AutoCompleteDictionarydata - 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.public java.util.Iterator<java.lang.String> iterator()
iterator in interface java.lang.Iterable<java.lang.String>public void clear()
clear in interface AutoCompleteDictionary
|
LimeWire collection component api | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||