|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--tapestry.support.util.Dice
A class for simulating a die, i.e., an object "rolled" to generate a random number between 1 and the number of sides.
Constructor Summary | |
Dice(int numSides)
Creates a single die with the number of sides specified by numSides (e.g., 2 is a coin, 6 is a cubed die). |
Method Summary | |
int |
getNumRolls()
Returns the number of times roll() has been called for a specific dice. |
int |
getNumSides()
Returns the number of sides for a specific dice. |
int |
roll()
Returns the random "roll" of the die, a uniformly distributed random number between 1 and numSides. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Dice(int numSides)
numSides
- number of sides on dieMethod Detail |
public int roll()
public int getNumRolls()
public int getNumSides()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |