|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dolben.MarkX.Monitor
class Monitor
A Monitor has a list of Requirements, one for each guess, and checks that a digit conforms to those Requirements, simply aggregating the effect of the individual Requirements.
Constructor Summary | |
---|---|
Monitor(int maxGuesses)
|
Method Summary | |
---|---|
void |
addRequirement(Requirement requirement)
adds a Requirement |
boolean |
pick(int digit,
int left)
checks that the a digit can be picked with a number of places left in the guess and informs all the Requirements of the pick when they all approve |
boolean |
removeRequirement()
removes the last Requirement, for backing up when guess scoring is inconsistent |
java.lang.String |
toString()
makes a string of the last Requirement |
void |
unpick(int digit)
tells all of the Requirements for this Monitor to retract the pick of a digit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
Monitor(int maxGuesses)
Method Detail |
---|
public void addRequirement(Requirement requirement)
requirement
- the Requirement added for the next guesspublic boolean removeRequirement()
public boolean pick(int digit, int left)
digit
- the digit to be checkedleft
- the number of places left for digits to be picked in the guess
public void unpick(int digit)
digit
- the digit that is no longer pickedpublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |