|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object becker.xtras.jotto.Word
public class Word
Store one word together with its difficulty.
Constructor Summary | |
---|---|
Word(Scanner in)
Read one word from an open file. |
|
Word(String aWord,
int aLevel)
Construct a new Word object. |
Method Summary | |
---|---|
int |
getDifficulty()
Get the difficulty level. |
String |
getWord()
Get the word. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Word(Scanner in)
File format is a word followed by its difficulty, one pair per line. The difficulty must be in the range of 0..2. The file cursor is expected immediately before the word and will be left immediately before the following word in the file. For example:
TRUCK 0 FOLLY 1 LIGHT 0 EMBAY 2 ...
in
- An open input file.public Word(String aWord, int aLevel)
aWord
- a word with the length specified by JottoModel.NUM_LETTERSaLevel
- a difficulty level. One of {0, 1, 2}.Method Detail |
---|
public int getDifficulty()
public String getWord()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |