java.lang.Object
java.util.Random
io.jenetics.util.RandomAdapter
- All Implemented Interfaces:
Serializable,RandomGenerator
Some places in the Java API still require a
Random object instead of
the new RandomGenerator. This class can be used by using this adapter
class.
final var random = RandomGenerator.getDefault();
final var bi = new BigInteger(100, RandomAdapter.of(random));
- Since:
- 7.0
- Version:
- 7.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.random.RandomGenerator
RandomGenerator.ArbitrarilyJumpableGenerator, RandomGenerator.JumpableGenerator, RandomGenerator.LeapableGenerator, RandomGenerator.SplittableGenerator, RandomGenerator.StreamableGenerator -
Method Summary
Modifier and TypeMethodDescriptiondoubles()doubles(double randomNumberOrigin, double randomNumberBound) doubles(long streamSize) doubles(long streamSize, double randomNumberOrigin, double randomNumberBound) ints()ints(int randomNumberOrigin, int randomNumberBound) ints(long streamSize) ints(long streamSize, int randomNumberOrigin, int randomNumberBound) booleanlongs()longs(long streamSize) longs(long randomNumberOrigin, long randomNumberBound) longs(long streamSize, long randomNumberOrigin, long randomNumberBound) booleanvoidnextBytes(byte[] bytes) doubledoublenextDouble(double bound) doublenextDouble(double origin, double bound) doublefloatfloatnextFloat(float bound) floatnextFloat(float origin, float bound) doubledoublenextGaussian(double mean, double stddev) intnextInt()intnextInt(int bound) intnextInt(int origin, int bound) longnextLong()longnextLong(long bound) longnextLong(long origin, long bound) static Randomof(RandomGenerator random) Create a newRandomobject from the givenrandomgenerator.
-
Method Details
-
isDeprecated
-
doubles
- Specified by:
doublesin interfaceRandomGenerator- Overrides:
doublesin classRandom
-
doubles
- Specified by:
doublesin interfaceRandomGenerator- Overrides:
doublesin classRandom
-
doubles
- Specified by:
doublesin interfaceRandomGenerator- Overrides:
doublesin classRandom
-
doubles
- Specified by:
doublesin interfaceRandomGenerator- Overrides:
doublesin classRandom
-
ints
- Specified by:
intsin interfaceRandomGenerator- Overrides:
intsin classRandom
-
ints
- Specified by:
intsin interfaceRandomGenerator- Overrides:
intsin classRandom
-
ints
- Specified by:
intsin interfaceRandomGenerator- Overrides:
intsin classRandom
-
ints
- Specified by:
intsin interfaceRandomGenerator- Overrides:
intsin classRandom
-
longs
- Specified by:
longsin interfaceRandomGenerator- Overrides:
longsin classRandom
-
longs
- Specified by:
longsin interfaceRandomGenerator- Overrides:
longsin classRandom
-
longs
- Specified by:
longsin interfaceRandomGenerator- Overrides:
longsin classRandom
-
longs
- Specified by:
longsin interfaceRandomGenerator- Overrides:
longsin classRandom
-
nextBoolean
- Specified by:
nextBooleanin interfaceRandomGenerator- Overrides:
nextBooleanin classRandom
-
nextBytes
- Specified by:
nextBytesin interfaceRandomGenerator- Overrides:
nextBytesin classRandom
-
nextFloat
- Specified by:
nextFloatin interfaceRandomGenerator- Overrides:
nextFloatin classRandom
-
nextFloat
-
nextFloat
-
nextDouble
- Specified by:
nextDoublein interfaceRandomGenerator- Overrides:
nextDoublein classRandom
-
nextDouble
-
nextDouble
-
nextInt
- Specified by:
nextIntin interfaceRandomGenerator- Overrides:
nextIntin classRandom
-
nextInt
- Specified by:
nextIntin interfaceRandomGenerator- Overrides:
nextIntin classRandom
-
nextInt
-
nextLong
- Specified by:
nextLongin interfaceRandomGenerator- Overrides:
nextLongin classRandom
-
nextLong
-
nextLong
-
nextGaussian
- Specified by:
nextGaussianin interfaceRandomGenerator- Overrides:
nextGaussianin classRandom
-
nextGaussian
-
nextExponential
-
of
Create a newRandomobject from the givenrandomgenerator.- Parameters:
random- the random generator to adapt- Returns:
- the adapted random generator
-