org.apache.commons.lang.math
Class RandomUtils
RandomUtils
is a wrapper that supports all possible
Random
methods via the
Math.random()
method and its system-wide
Random
object.
$Id: RandomUtils.java 155423 2005-02-26 13:08:30Z dirkv $- Henri Yandell
- Gary D. Gregory
static boolean | nextBoolean() - Returns the next pseudorandom, uniformly distributed boolean value
from the Math.random() sequence.
|
static boolean | nextBoolean(Random random) - Returns the next pseudorandom, uniformly distributed boolean value
from the given random sequence.
|
static double | nextDouble() - Returns the next pseudorandom, uniformly distributed float value
between
0.0 and 1.0 from the Math.random()
sequence.
|
static double | nextDouble(Random random) - Returns the next pseudorandom, uniformly distributed float value
between
0.0 and 1.0 from the given Random
sequence.
|
static float | nextFloat() - Returns the next pseudorandom, uniformly distributed float value
between
0.0 and 1.0 from the Math.random()
sequence.
|
static float | nextFloat(Random random) - Returns the next pseudorandom, uniformly distributed float value
between
0.0 and 1.0 from the given Random
sequence.
|
static int | nextInt() - Returns the next pseudorandom, uniformly distributed int value
from the Math.random() sequence.
|
static int | nextInt(Random random) - Returns the next pseudorandom, uniformly distributed int value
from the given
random sequence.
|
static int | nextInt(Random random, int n) - Returns a pseudorandom, uniformly distributed int value
between
0 (inclusive) and the specified value
(exclusive), from the given Random sequence.
|
static int | nextInt(int n) - Returns a pseudorandom, uniformly distributed int value
between
0 (inclusive) and the specified value
(exclusive), from the Math.random() sequence.
|
static long | nextLong() - Returns the next pseudorandom, uniformly distributed long value
from the Math.random() sequence.
|
static long | nextLong(Random random) - Returns the next pseudorandom, uniformly distributed long value
from the given Random sequence.
|
JVM_RANDOM
public static final Random JVM_RANDOM
nextBoolean
public static boolean nextBoolean()
Returns the next pseudorandom, uniformly distributed boolean value
from the Math.random() sequence.
nextBoolean
public static boolean nextBoolean(Random random)
Returns the next pseudorandom, uniformly distributed boolean value
from the given random sequence.
random
- the Random sequence generator.
nextDouble
public static double nextDouble()
Returns the next pseudorandom, uniformly distributed float value
between 0.0
and 1.0
from the Math.random()
sequence.
nextDouble
public static double nextDouble(Random random)
Returns the next pseudorandom, uniformly distributed float value
between 0.0
and 1.0
from the given Random
sequence.
random
- the Random sequence generator.
nextFloat
public static float nextFloat()
Returns the next pseudorandom, uniformly distributed float value
between 0.0
and 1.0
from the Math.random()
sequence.
nextFloat
public static float nextFloat(Random random)
Returns the next pseudorandom, uniformly distributed float value
between 0.0
and 1.0
from the given Random
sequence.
random
- the Random sequence generator.
nextInt
public static int nextInt()
Returns the next pseudorandom, uniformly distributed int value
from the Math.random() sequence.
nextInt
public static int nextInt(Random random)
Returns the next pseudorandom, uniformly distributed int value
from the given random
sequence.
random
- the Random sequence generator.
nextInt
public static int nextInt(Random random,
int n)
Returns a pseudorandom, uniformly distributed int value
between 0
(inclusive) and the specified value
(exclusive), from the given Random sequence.
random
- the Random sequence generator.n
- the specified exclusive max-value
nextInt
public static int nextInt(int n)
Returns a pseudorandom, uniformly distributed int value
between 0
(inclusive) and the specified value
(exclusive), from the Math.random() sequence.
n
- the specified exclusive max-value
nextLong
public static long nextLong()
Returns the next pseudorandom, uniformly distributed long value
from the Math.random() sequence.
nextLong
public static long nextLong(Random random)
Returns the next pseudorandom, uniformly distributed long value
from the given Random sequence.
random
- the Random sequence generator.
Copyright © 2001-2005 - Apache Software Foundation