tapestry.support.util
Class ColorDice

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

public class ColorDice
extends java.lang.Object

A class for simulating a die with colors on its sides instead of standard numbers, i.e., an object "rolled" to generate a random color.

See Also:
Color

Constructor Summary
ColorDice()
          Creates a single die for creating random colors.
 
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.Color roll()
          Returns the random "roll" of the die, a uniformly distributed random color between 1 and number of possible colors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorDice

public ColorDice()
Creates a single die for creating random colors.
Method Detail

roll

public java.awt.Color roll()
Returns the random "roll" of the die, a uniformly distributed random color between 1 and number of possible colors.

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.