|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbecker.xtras.jotto.JottoModel
public class JottoModel
JottoModel plays a game of Jotto. To run, it needs to be connected
to an instance of JottoGUI
. Significant parts of the
class may be replaced with student-written code using various constructors.
Field Summary | |
---|---|
static String[] |
LEVELS
|
static int |
MAX_GUESSES
|
static String |
NEW_GAME
|
static int |
NUM_LETTERS
|
Constructor Summary | |
---|---|
JottoModel()
|
|
JottoModel(IWordList wl)
|
|
JottoModel(IWordList wl,
IGuessEvaluator ge)
|
|
JottoModel(String aTarget,
IWordList wordList,
IGuessEvaluator guessEvaluator)
Create a new instance of JottoModel to play the game. |
Method Summary | |
---|---|
void |
addHint(Hint aHint)
|
void |
addObserver(IObserver observer)
Add an observer to a list of observers. |
static void |
main(String[] args)
|
void |
removeObserver(IObserver observer)
Remove a specific observer from the list of observers. |
void |
removeObservers()
Remove all the observers from the list of observers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String[] LEVELS
public static final int MAX_GUESSES
public static final int NUM_LETTERS
public static final String NEW_GAME
Constructor Detail |
---|
public JottoModel()
public JottoModel(IWordList wl)
public JottoModel(IWordList wl, IGuessEvaluator ge)
public JottoModel(String aTarget, IWordList wordList, IGuessEvaluator guessEvaluator)
aTarget
- The word the user will try to guesswordList
- A list of valid words.Method Detail |
---|
public void addHint(Hint aHint)
public void removeObservers()
IObservable
removeObservers
in interface IObservable
public void removeObserver(IObserver observer)
IObservable
removeObserver
in interface IObservable
observer
- The observer to remove.public void addObserver(IObserver observer)
IObservable
addObserver
in interface IObservable
observer
- The observer to add.public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |