public class RandomNumberProvider extends Object implements IRandomNumberProvider
| Constructor and Description |
|---|
RandomNumberProvider() |
| Modifier and Type | Method and Description |
|---|---|
ComponentDescriptor |
getComponentDescriptor()
Create a component descriptor which describes the dependencies and
provided interfaces of this component.
|
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. |
public ComponentDescriptor getComponentDescriptor()
IComponentgetComponentDescriptor in interface IComponentpublic int nextInt()
IRandomNumberProviderint
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.nextInt in interface IRandomNumberProviderint
valuepublic int nextInt(int bound)
IRandomNumberProviderint value
between 0 (inclusive) and the specified value (exclusive).nextInt in interface IRandomNumberProviderbound - the upper bound (exclusive). Must be positive.int
value between zero (inclusive) and bound (exclusive)public long nextLong()
IRandomNumberProviderlong
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.nextLong in interface IRandomNumberProviderint
valuepublic boolean nextBoolean()
IRandomNumberProviderboolean
value.nextBoolean in interface IRandomNumberProviderboolean
valuepublic void nextBytes(byte[] bytes)
IRandomNumberProvidernextBytes in interface IRandomNumberProviderbytes - the byte array to fill with random bytespublic float nextFloat()
IRandomNumberProviderfloat
value between 0.0 and 1.0.nextFloat in interface IRandomNumberProviderfloat
value between 0.0 and 1.0public double nextDouble()
IRandomNumberProviderdouble
value between 0.0 and 1.0.nextDouble in interface IRandomNumberProviderdouble
value between 0.0 and 1.0public double nextGaussian()
IRandomNumberProviderdouble value with mean 0.0 and standard
deviation 1.0.nextGaussian in interface IRandomNumberProviderdouble value with mean 0.0 and
standard deviation 1.0Copyright © 2018 Symphony Software Foundation. All rights reserved.