Class RandomUtils
RandomUtils
is a wrapper that supports all possible
Random
methods via the Math.random()
method and its system-wide Random
object.
- Since:
- 2.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Deprecated.Returns the next pseudorandom, uniformly distributed boolean value from the Math.random() sequence.static boolean
nextBoolean
(Random random) Deprecated.Returns the next pseudorandom, uniformly distributed boolean value from the given random sequence.static double
Deprecated.Returns the next pseudorandom, uniformly distributed float value between0.0
and1.0
from the Math.random() sequence.static double
nextDouble
(Random random) Deprecated.Returns the next pseudorandom, uniformly distributed float value between0.0
and1.0
from the given Random sequence.static float
Deprecated.Returns the next pseudorandom, uniformly distributed float value between0.0
and1.0
from the Math.random() sequence.static float
Deprecated.Returns the next pseudorandom, uniformly distributed float value between0.0
and1.0
from the given Random sequence.static int
nextInt()
Deprecated.Returns the next pseudorandom, uniformly distributed int value from the Math.random() sequence.static int
nextInt
(int n) Deprecated.Returns a pseudorandom, uniformly distributed int value between0
(inclusive) and the specified value (exclusive), from the Math.random() sequence.static int
Deprecated.Returns the next pseudorandom, uniformly distributed int value from the givenrandom
sequence.static int
Deprecated.Returns a pseudorandom, uniformly distributed int value between0
(inclusive) and the specified value (exclusive), from the given Random sequence.static long
nextLong()
Deprecated.Returns the next pseudorandom, uniformly distributed long value from the Math.random() sequence.static long
Deprecated.Returns the next pseudorandom, uniformly distributed long value from the given Random sequence.
-
Field Details
-
JVM_RANDOM
Deprecated.An instance ofJVMRandom
.
-
-
Constructor Details
-
RandomUtils
public RandomUtils()Deprecated.
-
-
Method Details
-
nextInt
public static int nextInt()Deprecated.Returns the next pseudorandom, uniformly distributed int value from the Math.random() sequence.
N.B. All values are >= 0.- Returns:
- the random int
-
nextInt
Deprecated.Returns the next pseudorandom, uniformly distributed int value from the given
random
sequence.- Parameters:
random
- the Random sequence generator.- Returns:
- the random int
-
nextInt
public static int nextInt(int n) Deprecated.Returns a pseudorandom, uniformly distributed int value between
0
(inclusive) and the specified value (exclusive), from the Math.random() sequence.- Parameters:
n
- the specified exclusive max-value- Returns:
- the random int
-
nextInt
Deprecated.Returns a pseudorandom, uniformly distributed int value between
0
(inclusive) and the specified value (exclusive), from the given Random sequence.- Parameters:
random
- the Random sequence generator.n
- the specified exclusive max-value- Returns:
- the random int
-
nextLong
public static long nextLong()Deprecated.Returns the next pseudorandom, uniformly distributed long value from the Math.random() sequence.
N.B. All values are >= 0.- Returns:
- the random long
-
nextLong
Deprecated.Returns the next pseudorandom, uniformly distributed long value from the given Random sequence.
- Parameters:
random
- the Random sequence generator.- Returns:
- the random long
-
nextBoolean
public static boolean nextBoolean()Deprecated.Returns the next pseudorandom, uniformly distributed boolean value from the Math.random() sequence.
- Returns:
- the random boolean
-
nextBoolean
Deprecated.Returns the next pseudorandom, uniformly distributed boolean value from the given random sequence.
- Parameters:
random
- the Random sequence generator.- Returns:
- the random boolean
-
nextFloat
public static float nextFloat()Deprecated.Returns the next pseudorandom, uniformly distributed float value between
0.0
and1.0
from the Math.random() sequence.- Returns:
- the random float
-
nextFloat
Deprecated.Returns the next pseudorandom, uniformly distributed float value between
0.0
and1.0
from the given Random sequence.- Parameters:
random
- the Random sequence generator.- Returns:
- the random float
-
nextDouble
public static double nextDouble()Deprecated.Returns the next pseudorandom, uniformly distributed float value between
0.0
and1.0
from the Math.random() sequence.- Returns:
- the random double
-
nextDouble
Deprecated.Returns the next pseudorandom, uniformly distributed float value between
0.0
and1.0
from the given Random sequence.- Parameters:
random
- the Random sequence generator.- Returns:
- the random double
-