com.limegroup.gnutella.util
Interface AutoCompleteDictionary

All Known Implementing Classes:
TrieSet

public interface AutoCompleteDictionary

This interface defines the API that dictionaries for autocomplete components must implement. Note that implementations of this interface should perform look ups as quickly as possible to avoid delays as the user types.


Method Summary
 void addEntry(java.lang.String s)
          Adds an entry to the dictionary.
 java.lang.String lookup(java.lang.String s)
          Perform a lookup and returns the closest matching string to the passed string.
 boolean removeEntry(java.lang.String s)
          Removes an entry from the dictionary.
 

Method Detail

addEntry

public void addEntry(java.lang.String s)
Adds an entry to the dictionary.

Parameters:
s - The string to add to the dictionary.

removeEntry

public boolean removeEntry(java.lang.String s)
Removes an entry from the dictionary.

Parameters:
s - The string to remove to the dictionary.
Returns:
True if successful, false if the string is not contained or cannot be removed.

lookup

public java.lang.String lookup(java.lang.String s)
Perform a lookup and returns the closest matching string to the passed string.

Parameters:
s - 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.