com.epochx.random
Class JavaRandom

java.lang.Object
  extended by com.epochx.random.JavaRandom
All Implemented Interfaces:
RandomNumberGenerator

public class JavaRandom
extends java.lang.Object
implements RandomNumberGenerator


Constructor Summary
JavaRandom()
           
 
Method Summary
 boolean nextBoolean()
          Get the next boolean
 double nextDouble()
          Get the next double 0<=x<1
 int nextInt()
          Get the next int
 int nextInt(int n)
          Get the next int, where n is max
 void setSeed(long l)
          Set the seed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaRandom

public JavaRandom()
Method Detail

nextBoolean

public boolean nextBoolean()
Description copied from interface: RandomNumberGenerator
Get the next boolean

Specified by:
nextBoolean in interface RandomNumberGenerator
Returns:
next boolean

nextDouble

public double nextDouble()
Description copied from interface: RandomNumberGenerator
Get the next double 0<=x<1

Specified by:
nextDouble in interface RandomNumberGenerator
Returns:
next double

nextInt

public int nextInt(int n)
Description copied from interface: RandomNumberGenerator
Get the next int, where n is max

Specified by:
nextInt in interface RandomNumberGenerator
Parameters:
n - max in value
Returns:
next random int

nextInt

public int nextInt()
Description copied from interface: RandomNumberGenerator
Get the next int

Specified by:
nextInt in interface RandomNumberGenerator
Returns:
next int

setSeed

public void setSeed(long l)
Description copied from interface: RandomNumberGenerator
Set the seed

Specified by:
setSeed in interface RandomNumberGenerator
Parameters:
l - seed