public class RandomUtils extends Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
RandomUtils.DataGenerator |
Various random data generation routines.
|
| Modifier and Type | Method | Description |
|---|---|---|
static org.apache.commons.rng.UniformRandomProvider |
asUniformRandomProvider(Random rng) |
Wraps a
Random instance. |
static RandomUtils.DataGenerator |
createDataGenerator(Random rng) |
Wraps an instance of the JDK's
Random class. |
static RandomUtils.DataGenerator |
createDataGenerator(org.apache.commons.rng.UniformRandomProvider rng) |
public static RandomUtils.DataGenerator createDataGenerator(org.apache.commons.rng.UniformRandomProvider rng)
rng - Underlying generator. Reference is copied so the RNG
is shared with the caller.data generator.public static RandomUtils.DataGenerator createDataGenerator(Random rng)
Random class.
The actual generation of random numbers will be delegated to that
instance.
If cryptographically secure data is required, one can use this
factory method, with an instance of the SecureRandom
class as the argument.
Note that data generation will be much slower in this case.
rng - Underlying generator. Reference is copied so the RNG
is shared with the caller.data generator.public static org.apache.commons.rng.UniformRandomProvider asUniformRandomProvider(Random rng)
Random instance.rng - JDK Random instance to which the random number
generation is delegated. Reference is copied so the RNG is shared
with the caller.UniformRandomProvider instance.Copyright © 2003–2017 The Apache Software Foundation. All rights reserved.