|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectWordlist
public class Wordlist
Wordlist is a list of words to use in Hangman. It can return a single secret word upon request.
Field Summary | |
---|---|
private int |
current
Current position in list |
static java.lang.String |
kWordFile
The name of the file containing words. |
private java.util.List<java.lang.String> |
list
the list of words |
private boolean |
sequential
retrieve words in order? (for testing) |
Constructor Summary | |
---|---|
Wordlist(boolean order)
Construct a word list to be accessed either sequentially (for testing) or randomly. |
Method Summary | |
---|---|
java.lang.String |
getSecretWord()
Obtain a secret word from the word list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String kWordFile
private java.util.List<java.lang.String> list
private int current
private boolean sequential
Constructor Detail |
---|
public Wordlist(boolean order)
order
- true for sequential, false for random.Method Detail |
---|
public java.lang.String getSecretWord()
getSecretWord
in interface I_WordSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |