Package com.teamdev.jxbrowser.spellcheck
Interface Dictionary
public interface Dictionary
Provides functionality for working with a spell check dictionary.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds the givenword
to the dictionary and schedules a write to disk.boolean
Returnstrue
if the dictionary contains the givenword
.boolean
Removes the givenword
from the dictionary and schedules a write to disk.words()
Returns the words in the current dictionary or an empty collection if the dictionary does not have any word.
-
Method Details
-
words
Collection<String> words()Returns the words in the current dictionary or an empty collection if the dictionary does not have any word.- Throws:
ObjectClosedException
- when the engine is closed
-
add
Adds the givenword
to the dictionary and schedules a write to disk.- Parameters:
word
- a word to add to the dictionary. It must be UTF8, between 1 and 99 bytes long, and without leading or trailing ASCII whitespace- Returns:
true
if the givenword
is valid and not a duplicate- Throws:
IllegalArgumentException
- whenword
is empty or blankObjectClosedException
- when the engine is closed
-
remove
Removes the givenword
from the dictionary and schedules a write to disk.- Parameters:
word
- a word to remove from the dictionary. It must be UTF8, between 1 and 99 bytes long, and without leading or trailing ASCII whitespace- Returns:
true
if the givenword
was found and removed successfully- Throws:
IllegalArgumentException
- whenword
is empty or blankObjectClosedException
- when the engine is closed
-
has
Returnstrue
if the dictionary contains the givenword
.- Parameters:
word
- a word to check. It must be UTF8, between 1 and 99 bytes long, and without leading or trailing ASCII whitespace- Throws:
IllegalArgumentException
- whenword
is empty or blankObjectClosedException
- when the engine is closed
-