| Constructor and Description |
|---|
RandomCompat()
Constructs object, inner
random created with default constructor. |
RandomCompat(long seed)
Constructs object, inner
random created with seed passed as param. |
RandomCompat(Random random)
Constructs object with the given
Random instance. |
| Modifier and Type | Method and Description |
|---|---|
DoubleStream |
doubles()
Returns an effectively unlimited stream of pseudorandom
double values,
each between zero (inclusive) and one (exclusive). |
DoubleStream |
doubles(double randomNumberOrigin,
double randomNumberBound)
Returns an effectively unlimited stream of pseudorandom
double
values, each conforming to the given origin (inclusive) and bound (exclusive) |
DoubleStream |
doubles(long streamSize)
Returns a stream producing the given
streamSize number of
pseudorandom double values, each between zero (inclusive)
and one (exclusive). |
DoubleStream |
doubles(long streamSize,
double randomNumberOrigin,
double randomNumberBound)
Returns a stream producing the given
streamSize number
of pseudorandom double values, each conforming
to the given origin (inclusive) and bound (exclusive). |
Random |
getRandom()
Returns underlying
Random instance. |
IntStream |
ints()
Returns an effectively unlimited stream of pseudorandom
int
values. |
IntStream |
ints(int randomNumberOrigin,
int randomNumberBound)
Returns an effectively unlimited stream of pseudorandom
int
values, each conforming to the given origin (inclusive) and bound (exclusive) |
IntStream |
ints(long streamSize)
Returns a stream producing the given
streamSize number of
pseudorandom int values. |
IntStream |
ints(long streamSize,
int randomNumberOrigin,
int randomNumberBound)
Returns a stream producing the given
streamSize number
of pseudorandom int values, each conforming to the given
origin (inclusive) and bound (exclusive). |
LongStream |
longs()
Returns an effectively unlimited stream of pseudorandom
long values,
each between zero (inclusive) and one (exclusive). |
LongStream |
longs(long streamSize)
Returns a stream producing the given
streamSize number of
pseudorandom long values, each between zero (inclusive)
and one (exclusive). |
LongStream |
longs(long randomNumberOrigin,
long randomNumberBound)
Returns an effectively unlimited stream of pseudorandom
long
values, each conforming to the given origin (inclusive) and bound (exclusive) |
LongStream |
longs(long streamSize,
long randomNumberOrigin,
long randomNumberBound)
Returns a stream producing the given
streamSize number
of pseudorandom long values, each conforming
to the given origin (inclusive) and bound (exclusive). |
public RandomCompat()
random created with default constructor.public RandomCompat(long seed)
random created with seed passed as param.seed - seed to initialize random objectpublic RandomCompat(Random random)
Random instance.random - Random instancepublic Random getRandom()
Random instance.Random object instancepublic IntStream ints(long streamSize)
streamSize number of
pseudorandom int values.
A pseudorandom int value is generated as if it's the result of
calling the method Random.nextInt()
streamSize - the number of values to generateint valuesIllegalArgumentException - if streamSize is
less than zeropublic LongStream longs(long streamSize)
streamSize number of
pseudorandom long values, each between zero (inclusive)
and one (exclusive).
A pseudorandom long value is generated as if it's the result of
calling the method Random.nextLong()
streamSize - the number of values to generatelong valuesIllegalArgumentException - if streamSize is
less than zeropublic DoubleStream doubles(long streamSize)
streamSize number of
pseudorandom double values, each between zero (inclusive)
and one (exclusive).
A pseudorandom double value is generated as if it's the result of
calling the method Random.nextDouble()
streamSize - the number of values to generatedouble valuesIllegalArgumentException - if streamSize is
less than zeropublic IntStream ints()
int
values.
A pseudorandom int value is generated as if it's the result of
calling the method Random.nextInt().
int valuespublic LongStream longs()
long values,
each between zero (inclusive) and one (exclusive).
A pseudorandom long value is generated as if it's the result of
calling the method Random.nextLong().
long valuespublic DoubleStream doubles()
double values,
each between zero (inclusive) and one (exclusive).
A pseudorandom double value is generated as if it's the result of
calling the method Random.nextDouble().
double valuespublic IntStream ints(long streamSize, int randomNumberOrigin, int randomNumberBound)
streamSize number
of pseudorandom int values, each conforming to the given
origin (inclusive) and bound (exclusive).streamSize - the number of values to generaterandomNumberOrigin - the origin (inclusive) of each random valuerandomNumberBound - the bound (exclusive) if each random valueint values,
each with the given origin (inclusive) and bound (exclusive)IllegalArgumentException - if streamSize is
less than zero, or randomNumberOrigin is
greater than or equal to randomNumberBoundpublic LongStream longs(long streamSize, long randomNumberOrigin, long randomNumberBound)
streamSize number
of pseudorandom long values, each conforming
to the given origin (inclusive) and bound (exclusive).streamSize - the number of values to generaterandomNumberOrigin - the origin (inclusive) of each random valuerandomNumberBound - the bound (exclusive) if each random valuelong values,
each with the given origin (inclusive) and bound (exclusive)IllegalArgumentException - if streamSize is
less than zero, or randomNumberOrigin is
greater than or equal to randomNumberBoundpublic DoubleStream doubles(long streamSize, double randomNumberOrigin, double randomNumberBound)
streamSize number
of pseudorandom double values, each conforming
to the given origin (inclusive) and bound (exclusive).streamSize - the number of values to generaterandomNumberOrigin - the origin (inclusive) of each random valuerandomNumberBound - the bound (exclusive) if each random valuedouble values,
each with the given origin (inclusive) and bound (exclusive)IllegalArgumentException - if streamSize is
less than zero, or randomNumberOrigin is
greater than or equal to randomNumberBoundpublic IntStream ints(int randomNumberOrigin, int randomNumberBound)
int
values, each conforming to the given origin (inclusive) and bound (exclusive)randomNumberOrigin - the origin (inclusive) of each random valuerandomNumberBound - the bound (exclusive) of each random valueint values,
each with the given origin (inclusive) and bound (exclusive)IllegalArgumentException - if randomNumberOrigin
is greater than or equal to randomNumberBoundpublic LongStream longs(long randomNumberOrigin, long randomNumberBound)
long
values, each conforming to the given origin (inclusive) and bound (exclusive)randomNumberOrigin - the origin (inclusive) of each random valuerandomNumberBound - the bound (exclusive) of each random valuelong values,
each with the given origin (inclusive) and bound (exclusive)IllegalArgumentException - if randomNumberOrigin
is greater than or equal to randomNumberBoundpublic DoubleStream doubles(double randomNumberOrigin, double randomNumberBound)
double
values, each conforming to the given origin (inclusive) and bound (exclusive)randomNumberOrigin - the origin (inclusive) of each random valuerandomNumberBound - the bound (exclusive) of each random valuedouble values,
each with the given origin (inclusive) and bound (exclusive)IllegalArgumentException - if randomNumberOrigin
is greater than or equal to randomNumberBoundCopyright © 2018. All rights reserved.