public enum Dictionary extends Enum<Dictionary> implements Iterable<String>
Enum Constant and Description |
---|
INSTANCE
A reference to the dictionary object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String word)
Looks for the given word in the dictionary.
|
Iterator<String> |
iterator()
Return an iterator over the words in the dictionary.
|
static void |
main(String[] args) |
static Dictionary |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Dictionary[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Dictionary INSTANCE
Dictionary d = Dictionary.INSTANCE;
public static Dictionary[] values()
for (Dictionary c : Dictionary.values()) System.out.println(c);
public static Dictionary valueOf(String name)
IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullname
- the name of the enum constant to be returned.public Iterator<String> iterator()
iterator
in interface Iterable<String>
Iterable.iterator()
public boolean contains(String word)
true
if the dictionary contains word
, and is false
otherwise.word
- the word to lookup in the dictionarytrue
if the dictionary contains word
,
false
otherwise.public static void main(String[] args)