public interface IRandomNumberProvider extends IComponent
| Modifier and Type | Method and Description |
|---|---|
boolean |
nextBoolean()
Returns a pseudorandom, uniformly distributed
boolean
value. |
void |
nextBytes(byte[] bytes)
Generates random bytes and places them into a user-supplied
byte array.
|
double |
nextDouble()
Returns a pseudorandom, uniformly distributed
double
value between 0.0 and 1.0. |
float |
nextFloat()
Returns a pseudorandom, uniformly distributed
float
value between 0.0 and 1.0. |
double |
nextGaussian()
Returns a pseudorandom, Gaussian ("normally") distributed
double value with mean 0.0 and standard
deviation 1.0. |
int |
nextInt()
Returns a pseudorandom, uniformly distributed
int
value. |
int |
nextInt(int bound)
Returns a pseudorandom, uniformly distributed
int value
between 0 (inclusive) and the specified value (exclusive). |
long |
nextLong()
Returns a pseudorandom, uniformly distributed
long
value. |
getComponentDescriptorint nextInt()
int
value. The general
contract of nextInt is that one int value is
pseudorandomly generated and returned. All 232 possible
int values are produced with (approximately) equal probability.int
valueint nextInt(int bound)
int value
between 0 (inclusive) and the specified value (exclusive).bound - the upper bound (exclusive). Must be positive.int
value between zero (inclusive) and bound (exclusive)IllegalArgumentException - if bound is not positivelong nextLong()
long
value. The general
contract of nextInt is that one long value is
pseudorandomly generated and returned. All 264 possible
long values are produced with (approximately) equal probability.int
valueboolean nextBoolean()
boolean
value.boolean
valuevoid nextBytes(@Nonnull byte[] bytes)
bytes - the byte array to fill with random bytesNullPointerException - if the byte array is nullfloat nextFloat()
float
value between 0.0 and 1.0.float
value between 0.0 and 1.0double nextDouble()
double
value between 0.0 and 1.0.double
value between 0.0 and 1.0double nextGaussian()
double value with mean 0.0 and standard
deviation 1.0.double value with mean 0.0 and
standard deviation 1.0Copyright © 2018 Symphony Software Foundation. All rights reserved.