public class XorGensRandomGenerator extends AbstractRandomGenerator
Constructor and Description |
---|
XorGensRandomGenerator()
Creates a new generator, initializing its seed with
Util.randomSeed() . |
XorGensRandomGenerator(long seed)
Creates a new generator using a given seed.
|
Modifier and Type | Method and Description |
---|---|
boolean |
nextBoolean() |
void |
nextBytes(byte[] bytes) |
double |
nextDouble() |
float |
nextFloat() |
int |
nextInt() |
int |
nextInt(int n) |
long |
nextLong() |
long |
nextLong(long n) |
void |
setSeed(long seed) |
clear, nextGaussian, setSeed, setSeed
public XorGensRandomGenerator()
Util.randomSeed()
.public XorGensRandomGenerator(long seed)
seed
- a nonzero seed for the generator (if zero, the generator will be seeded with -1).public void setSeed(long seed)
setSeed
in interface RandomGenerator
setSeed
in class AbstractRandomGenerator
public long nextLong()
nextLong
in interface RandomGenerator
nextLong
in class AbstractRandomGenerator
public int nextInt()
nextInt
in interface RandomGenerator
nextInt
in class AbstractRandomGenerator
public int nextInt(int n)
nextInt
in interface RandomGenerator
nextInt
in class AbstractRandomGenerator
public long nextLong(long n)
public double nextDouble()
nextDouble
in interface RandomGenerator
nextDouble
in class AbstractRandomGenerator
public float nextFloat()
nextFloat
in interface RandomGenerator
nextFloat
in class AbstractRandomGenerator
public boolean nextBoolean()
nextBoolean
in interface RandomGenerator
nextBoolean
in class AbstractRandomGenerator
public void nextBytes(byte[] bytes)
nextBytes
in interface RandomGenerator
nextBytes
in class AbstractRandomGenerator