|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Random
org.apache.commons.lang.math.JVMRandom
public final class JVMRandom
JVMRandom
is a wrapper that supports all possible
Random methods via the Math.random()
method
and its system-wide Random
object.
Constructor Summary | |
---|---|
JVMRandom()
Constructs a new instance. |
Method Summary | |
---|---|
boolean |
nextBoolean()
Returns the next pseudorandom, uniformly distributed boolean value from the Math.random() sequence. |
void |
nextBytes(byte[] byteArray)
Unsupported in 2.0. |
double |
nextDouble()
Synonymous to the Math.random() call. |
float |
nextFloat()
Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from the Math.random()
sequence. |
double |
nextGaussian()
Unsupported in 2.0. |
int |
nextInt()
Returns the next pseudorandom, uniformly distributed int value from the Math.random() sequence. |
int |
nextInt(int n)
Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), from
the Math.random() sequence. |
long |
nextLong()
Returns the next pseudorandom, uniformly distributed long value from the Math.random() sequence. |
static long |
nextLong(long n)
Returns a pseudorandom, uniformly distributed long value between 0 (inclusive) and the specified value (exclusive), from
the Math.random() sequence. |
void |
setSeed(long seed)
Unsupported in 2.0. |
Methods inherited from class java.util.Random |
---|
next |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JVMRandom()
Method Detail |
---|
public void setSeed(long seed)
setSeed
in class java.util.Random
seed
- ignored
java.lang.UnsupportedOperationException
public double nextGaussian()
nextGaussian
in class java.util.Random
java.lang.UnsupportedOperationException
public void nextBytes(byte[] byteArray)
nextBytes
in class java.util.Random
byteArray
- ignored
java.lang.UnsupportedOperationException
public int nextInt()
Returns the next pseudorandom, uniformly distributed int value from the Math.random() sequence.
nextInt
in class java.util.Random
public int nextInt(int n)
Returns a pseudorandom, uniformly distributed int value between
0
(inclusive) and the specified value (exclusive), from
the Math.random() sequence.
nextInt
in class java.util.Random
n
- the specified exclusive max-value
java.lang.IllegalArgumentException
- when n <= 0
public long nextLong()
Returns the next pseudorandom, uniformly distributed long value from the Math.random() sequence.
nextLong
in class java.util.Random
public static long nextLong(long n)
Returns a pseudorandom, uniformly distributed long value between
0
(inclusive) and the specified value (exclusive), from
the Math.random() sequence.
n
- the specified exclusive max-value
java.lang.IllegalArgumentException
- when n <= 0
public boolean nextBoolean()
Returns the next pseudorandom, uniformly distributed boolean value from the Math.random() sequence.
nextBoolean
in class java.util.Random
public float nextFloat()
Returns the next pseudorandom, uniformly distributed float value
between 0.0
and 1.0
from the Math.random()
sequence.
nextFloat
in class java.util.Random
public double nextDouble()
Synonymous to the Math.random() call.
nextDouble
in class java.util.Random
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |