|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectai1.serverjava.numguess.model.NumberGuessBean
Model for the number guessing game. Encapsulates a random number between 1 (inclusive) and 100 (inclusive) and tells wether the correct number is guessed or not.
Constructor Summary | |
NumberGuessBean()
Generates a random number and constructs an instance with that number. |
Method Summary | |
java.lang.String |
getHint()
Returns a String indicating if the random number
is higher or lower than the last guess. |
int |
getRandomNumber()
Returns the random number. |
boolean |
guess(int guess)
Checks a guess. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NumberGuessBean()
Method Detail |
public boolean guess(int guess)
guess
- The value that is checked against
the random number.
true
if the guess was correct,
false
if the guess was incorrect.public int getRandomNumber()
public java.lang.String getHint()
String
indicating if the random number
is higher or lower than the last guess.
String higher
if the random number is
higher than the last guess, lower
if the
random number is lower and null
if it is
equal to the last guess..
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |