|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweiss.util.Random
public class Random
Random number class, using a 31-bit linear congruential generator.
Constructor Summary | |
---|---|
Random()
Construct this Random object with initial state obtained from system clock. |
|
Random(int initialValue)
Construct this Random object with specified initial state. |
Method Summary | ||
---|---|---|
static void |
main(java.lang.String[] args)
|
|
double |
nextDouble()
Return a pseudorandom double in the open range 0..1 and change the internal state. |
|
int |
nextInt()
Return a pseudorandom int, and change the internal state. |
|
int |
nextInt(int high)
Return a pseudorandom int in range [0..high), and change the internal state. |
|
int |
nextInt(int low,
int high)
Return an int in the closed range [low,high], and change the internal state. |
|
int |
nextIntWRONG()
Return a pseudorandom int, and change the internal state. |
|
long |
nextLong()
Return a long in the range [0, 2^62-1], and change the internal state. |
|
long |
nextLong(long low,
long high)
Return a long in the closed range [low,high], and change the internal state. |
|
double |
nextNegExp(double expectedValue)
Return a double using a negative exponential distribution, and change the internal state. |
|
int |
nextPoisson(double expectedValue)
Return an int using a Poisson distribution, and change the internal state. |
|
static
|
permute(AnyType[] a)
Randomly rearrange an array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Random()
public Random(int initialValue)
initialValue
- the initial state.Method Detail |
---|
public int nextInt()
public int nextInt(int high)
public int nextIntWRONG()
public double nextDouble()
public int nextInt(int low, int high)
low
- the minimum value returned.high
- the maximum value returned.
public long nextLong()
public long nextLong(long low, long high)
low
- the minimum value returned.high
- the maximum value returned.
public int nextPoisson(double expectedValue)
expectedValue
- the mean of the distribution.
public double nextNegExp(double expectedValue)
expectedValue
- the mean of the distribution.
public static final <AnyType> void permute(AnyType[] a)
a
- the array.public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |