tapestry.support.util
Class PointDice

java.lang.Object
  |
  +--tapestry.support.util.PointDice

public class PointDice
extends java.lang.Object

A class for simulating a die with points within a given bounds on its sides instead of standard numbers, i.e., an object "rolled" to generate a random position.

See Also:
Color

Constructor Summary
PointDice(java.awt.Rectangle bounds)
          Creates a single die for creating random points.
 
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.
 java.awt.Point roll()
          Returns the random "roll" of the die, a uniformly distributed point within the given bounds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointDice

public PointDice(java.awt.Rectangle bounds)
Creates a single die for creating random points.
Method Detail

roll

public java.awt.Point roll()
Returns the random "roll" of the die, a uniformly distributed point within the given bounds.

getNumRolls

public int getNumRolls()
Returns the number of times roll() has been called for a specific dice.

getNumSides

public int getNumSides()
Returns the number of sides for a specific dice.