public class SimpleDictionary extends java.lang.Object implements Dictionary
| Constructor and Description |
|---|
SimpleDictionary(java.lang.String resource)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.String word)
Returns true if this dictionary contains the specified word.
|
java.util.Iterator<java.lang.String> |
iterator()
Returns an iterator over the elements in this dictionary.
|
int |
size()
Returns the number of elements in this dictionary.
|
public SimpleDictionary(java.lang.String resource)
resource - the file name of dictionary. The file should be in plain
text, in which each line is a word.public boolean contains(java.lang.String word)
Dictionarycontains in interface Dictionarypublic int size()
Dictionarysize in interface Dictionarypublic java.util.Iterator<java.lang.String> iterator()
Dictionaryiterator in interface Dictionary