|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object GuessRange
public class GuessRange
This class maintains a range of integers and a random integer in that range, and allows the user to guess at the number.
Constructor Summary | |
---|---|
GuessRange(int low,
int high)
Constructs a range with the given limits and selects a random number from within that range. |
Method Summary | |
---|---|
int |
getHighLimit()
Accessor method to determine the current upper limit on the range. |
int |
getLowLimit()
Accessor method to determine the current lower limit on the range. |
int |
getNumberOfGuesses()
Accessor method to determine the number of guesses made so far. |
java.lang.String |
makeGuess(int guess)
Handles a guess at the number in the range, returning the result and updating the range appropriately. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GuessRange(int low, int high)
low
- lower limit on the range (inclusive)high
- upper limit on the range (inclusive)Method Detail |
---|
public int getLowLimit()
public int getHighLimit()
public int getNumberOfGuesses()
public java.lang.String makeGuess(int guess)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |