|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jtools.common.utils.RandomGenerator
Simple Random Generator class
$Id: RandomGenerator.java,v 1.2 2002/07/27 17:57:42 placson Exp $
Constructor Summary | |
RandomGenerator()
Constructor that initializes the RandomGenerator |
Method Summary | |
int |
getNext(int seed)
Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence. |
int |
getNext(int low,
int high)
Returns a pseudorandom, uniformly distributed int value between low and high, drawn from this random number generator's sequence. |
java.lang.Object |
getRandomItem(java.util.ArrayList list)
Returns a randomly selected element from the ArrayList |
java.lang.String |
getStringItem(java.util.ArrayList list)
Returns a randomly selected element from the ArrayList that is converted to a String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RandomGenerator()
Method Detail |
public int getNext(int seed)
public int getNext(int low, int high)
high
- the highest number allowedlow
- the lowest number allowdpublic java.lang.Object getRandomItem(java.util.ArrayList list)
list
- An ArrayList containing the list of elementspublic java.lang.String getStringItem(java.util.ArrayList list)
list
- An ArrayList containing the list of elements
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |