public interface Dictionary
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.lang.String word)
Adds the given
word to the dictionary and schedules a write to disk. |
boolean |
has(java.lang.String word)
Returns
true if the dictionary contains the given word . |
boolean |
remove(java.lang.String word)
Removes the given
word from the dictionary and schedules a write to disk. |
java.util.Collection<java.lang.String> |
words()
Returns the words in the current dictionary or an empty collection if the dictionary does not
have any word.
|
java.util.Collection<java.lang.String> words()
ObjectClosedException
- when the engine is closedboolean add(java.lang.String word)
word
to the dictionary and schedules a write to disk.word
- a word to add to the dictionary. It must be UTF8, between 1 and 99 bytes long,
and without leading or trailing ASCII whitespacetrue
if the given word
is valid and not a duplicatejava.lang.IllegalArgumentException
- when word
is empty or blankObjectClosedException
- when the engine is closedboolean remove(java.lang.String word)
word
from the dictionary and schedules a write to disk.word
- a word to remove from the dictionary. It must be UTF8, between 1 and 99 bytes
long, and without leading or trailing ASCII whitespacetrue
if the given word
was found and removed successfullyjava.lang.IllegalArgumentException
- when word
is empty or blankObjectClosedException
- when the engine is closedboolean has(java.lang.String word)
true
if the dictionary contains the given word
.word
- a word to check. It must be UTF8, between 1 and 99 bytes long, and without
leading or trailing ASCII whitespacejava.lang.IllegalArgumentException
- when word
is empty or blankObjectClosedException
- when the engine is closed