Package org.apache.solr.bench
Class SplittableRandomGenerator
- java.lang.Object
-
- org.apache.solr.bench.SplittableRandomGenerator
-
- All Implemented Interfaces:
org.apache.commons.math3.random.RandomGenerator
public class SplittableRandomGenerator extends Object implements org.apache.commons.math3.random.RandomGenerator
Extension ofjava.util.SplittableRandom
to implementRandomGenerator
.
-
-
Constructor Summary
Constructors Constructor Description SplittableRandomGenerator(long seed)
Instantiates a new Splittable random generator.SplittableRandomGenerator(SplittableRandom random)
Instantiates a new Splittable random generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
nextBoolean()
void
nextBytes(byte[] bytes)
double
nextDouble()
float
nextFloat()
double
nextGaussian()
int
nextInt()
int
nextInt(int n)
long
nextLong()
void
setSeed(int seed)
void
setSeed(int[] seed)
void
setSeed(long seed)
-
-
-
Constructor Detail
-
SplittableRandomGenerator
public SplittableRandomGenerator(SplittableRandom random)
Instantiates a new Splittable random generator.- Parameters:
random
- the random
-
SplittableRandomGenerator
public SplittableRandomGenerator(long seed)
Instantiates a new Splittable random generator.- Parameters:
seed
- the seed
-
-
Method Detail
-
setSeed
public void setSeed(int seed)
- Specified by:
setSeed
in interfaceorg.apache.commons.math3.random.RandomGenerator
-
setSeed
public void setSeed(int[] seed)
- Specified by:
setSeed
in interfaceorg.apache.commons.math3.random.RandomGenerator
-
setSeed
public void setSeed(long seed)
- Specified by:
setSeed
in interfaceorg.apache.commons.math3.random.RandomGenerator
-
nextBytes
public void nextBytes(byte[] bytes)
- Specified by:
nextBytes
in interfaceorg.apache.commons.math3.random.RandomGenerator
-
nextInt
public int nextInt()
- Specified by:
nextInt
in interfaceorg.apache.commons.math3.random.RandomGenerator
-
nextInt
public int nextInt(int n)
- Specified by:
nextInt
in interfaceorg.apache.commons.math3.random.RandomGenerator
-
nextLong
public long nextLong()
- Specified by:
nextLong
in interfaceorg.apache.commons.math3.random.RandomGenerator
-
nextBoolean
public boolean nextBoolean()
- Specified by:
nextBoolean
in interfaceorg.apache.commons.math3.random.RandomGenerator
-
nextFloat
public float nextFloat()
- Specified by:
nextFloat
in interfaceorg.apache.commons.math3.random.RandomGenerator
-
nextDouble
public double nextDouble()
- Specified by:
nextDouble
in interfaceorg.apache.commons.math3.random.RandomGenerator
-
nextGaussian
public double nextGaussian()
- Specified by:
nextGaussian
in interfaceorg.apache.commons.math3.random.RandomGenerator
-
-