|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softsynth.jmsl.util.RandomSequence
public class RandomSequence
Generate evenly distributed pseudo-random sequence of integers within a given inclusive range. By setting the seed, one can regenerate a prior sequence.
Constructor Summary | |
---|---|
RandomSequence()
|
Method Summary | |
---|---|
int |
choose(int numChoices)
|
int |
getMaximum()
|
int |
getMinimum()
|
int |
getNext()
|
int |
getSeed()
|
int |
next()
Generate next value. |
void |
randomize()
Set seed from system time. |
void |
reset()
Reset sequence generator so that it will restart at beginning. |
void |
setMaximum(int maximum)
Set maximum value returned by next(). If minimum is 5 and maximum is 8 then next() will return random values including 5,6,7 AND 8. |
void |
setMinimum(int minimum)
|
void |
setNext(int next)
Set next value in sequence. |
void |
setSeed(int seed)
Set sequence seed. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RandomSequence()
Method Detail |
---|
public void randomize()
randomize
in interface SequenceGenerator
public int choose(int numChoices)
public int next()
next
in interface SequenceGenerator
public int getNext()
getNext
in interface SequenceGenerator
public void setNext(int next)
setNext
in interface SequenceGenerator
public void setSeed(int seed)
setSeed
in interface SequenceGenerator
public int getSeed()
getSeed
in interface SequenceGenerator
public void reset()
reset
in interface SequenceGenerator
public int getMinimum()
public void setMinimum(int minimum)
public int getMaximum()
public void setMaximum(int maximum)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |