java.util
Class Random

java.lang.Object
  extended by java.util.Random

public class Random
extends Object

Pseudo-random number generation.


Constructor Summary
Random()
           
Random(long seed)
           
 
Method Summary
 boolean nextBoolean()
          Returns a random boolean in the range 0-1.
 double nextDouble()
           
 double nextGaussian()
          Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.
 int nextInt()
           
 int nextInt(int n)
          Returns a random integer in the range 0...n-1.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Random

public Random(long seed)

Random

public Random()
Method Detail

nextInt

public int nextInt()
Returns:
A random positive or negative integer.

nextInt

public int nextInt(int n)
Returns a random integer in the range 0...n-1.

Parameters:
n - the bound
Returns:
A random integer in the range 0...n-1.

nextBoolean

public boolean nextBoolean()
Returns a random boolean in the range 0-1.

Returns:
A random boolean in the range 0-1.

nextDouble

public double nextDouble()

nextGaussian

public double nextGaussian()
Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.

Returns:
Returns the next pseudorandom, Gaussian ("normally") distributed double value