tapestry.support.util
Class StringDice

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

public class StringDice
extends java.lang.Object

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

See Also:
String

Constructor Summary
StringDice()
          Creates a single die for creating random strings.
StringDice(int length)
          Creates a single die for creating random strings.
 
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.lang.String roll()
          Returns the random "roll" of the die, a uniformly distributed random string of length myLength.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringDice

public StringDice()
Creates a single die for creating random strings.

StringDice

public StringDice(int length)
Creates a single die for creating random strings.
Method Detail

roll

public java.lang.String roll()
Returns the random "roll" of the die, a uniformly distributed random string of length myLength.

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.