net.jakubholy.jedit.autocomplete
Interface WordList

All Known Implementing Classes:
WordListTreeSet

public interface WordList

A storage of words that can be used as completions. AutoComplete stores there all words typed so far that satisfy certain conditions given by the PreferencesManager.


Method Summary
 boolean add(net.jakubholy.jedit.autocomplete.Completion completion)
          Insert the completion into the list.
 void addAll(net.jakubholy.jedit.autocomplete.Completion[] completions)
           
 void addObserver(java.util.Observer o)
          Add an observer interested in receiving WordListEvents whenever the contents of this word list changes (completion added/removed, cleared).
 void clear()
          Removes all of the elements from this wordList.
 boolean containes(net.jakubholy.jedit.autocomplete.Completion completion)
          Return true if is in the list.
 void deleteObserver(java.util.Observer o)
          Stop observing this word list.
 net.jakubholy.jedit.autocomplete.Completion[] getAllWords()
          Returns all words in the list in a sorted array.
 net.jakubholy.jedit.autocomplete.Completion[] getCompletions(java.lang.String prefix)
          Return an array of all words in the list starting with the given prefix and longer than that prefix.
 boolean remove(net.jakubholy.jedit.autocomplete.Completion completion)
          Removes the specified element from this wordList if it is present.
 int size()
          Returns the number of elements in this wordlist.
 

Method Detail

getCompletions

net.jakubholy.jedit.autocomplete.Completion[] getCompletions(java.lang.String prefix)
Return an array of all words in the list starting with the given prefix and longer than that prefix.

Parameters:
prefix - The prefix whose completions we search; at least 1 letter.
Returns:
An array of possible completions of an empty array. Entries in the array are sorted.

getAllWords

net.jakubholy.jedit.autocomplete.Completion[] getAllWords()
Returns all words in the list in a sorted array.


add

boolean add(net.jakubholy.jedit.autocomplete.Completion completion)
Insert the completion into the list.

Returns:
False if the completion has already been in the list.

containes

boolean containes(net.jakubholy.jedit.autocomplete.Completion completion)
Return true if is in the list.


addAll

void addAll(net.jakubholy.jedit.autocomplete.Completion[] completions)

remove

boolean remove(net.jakubholy.jedit.autocomplete.Completion completion)
Removes the specified element from this wordList if it is present.


clear

void clear()
Removes all of the elements from this wordList.


size

int size()
Returns the number of elements in this wordlist.


addObserver

void addObserver(java.util.Observer o)
Add an observer interested in receiving WordListEvents whenever the contents of this word list changes (completion added/removed, cleared).


deleteObserver

void deleteObserver(java.util.Observer o)
Stop observing this word list.