public abstract class PooledGeneratorBase extends java.lang.Object implements Pooled
drawLong() method.
This base class supports pooling 2 RandomNumbers.| Modifier and Type | Field and Description |
|---|---|
protected RandomNumber |
first
The instance of the first RandomNumber.
|
static long |
MASK_31BIT |
static double |
MULTIPLICATIVE_FACTOR_31BIT |
static double |
MULTIPLICATIVE_FACTOR_32BIT |
protected RandomNumber |
second
The instance of the second RandomNumber.
|
| Constructor and Description |
|---|
PooledGeneratorBase()
Creates a new instance of PooledGeneratorBase with no RandomNumbers
specified.
|
| Modifier and Type | Method and Description |
|---|---|
RandomNumber |
getFirst()
Returns the instance of the first RandomNumber.
|
RandomNumber |
getSecond()
Returns the instance of the second RandomNumber.
|
long |
getSeed()
Do not use, get the seeds from the first or second RandomNumber.
|
long[] |
getSeeds()
Do not use, get the seeds from the first or second RandomNumber.
|
void |
resetSeed()
Resets seed to last setSeed() value
|
void |
setFirst(RandomNumber first)
Sets the instance of the first RandomNumber to be pooled.
|
void |
setSecond(RandomNumber second)
Sets the instance of the second RandomNumber to be pooled.
|
void |
setSeed(long seed)
Do not use, set the seeds of the first or second RandomNumber directly.
|
void |
setSeeds(long[] seed)
Do not use, set the seeds of the first or second RandomNumber directly.
|
java.lang.String |
toString()
Returns a String that contains the name of this pooled generator with information
about the two pooled RandomNumbers.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdraw, drawLong, getMultiplierpublic static final double MULTIPLICATIVE_FACTOR_32BIT
public static final double MULTIPLICATIVE_FACTOR_31BIT
public static final long MASK_31BIT
protected RandomNumber first
protected RandomNumber second
public PooledGeneratorBase()
public RandomNumber getFirst()
public RandomNumber getSecond()
public long getSeed()
getSeed in interface RandomNumberjava.lang.IllegalArgumentException - In all cases.public long[] getSeeds()
getSeeds in interface RandomNumberjava.lang.IllegalArgumentException - In all cases.public void resetSeed()
resetSeed in interface RandomNumberpublic void setFirst(RandomNumber first)
public void setSecond(RandomNumber second)
public void setSeed(long seed)
setSeed in interface RandomNumberseed - The new random number seedjava.lang.IllegalArgumentException - In all cases.public void setSeeds(long[] seed)
setSeeds in interface RandomNumberseed - The new array of seedsjava.lang.IllegalArgumentException - In all cases.public java.lang.String toString()
toString in class java.lang.Object