net.sf.myra.framework
Class RandomGenerator

java.lang.Object
  extended by net.sf.myra.framework.RandomGenerator

public abstract class RandomGenerator
extends java.lang.Object

This class represents the random number generation source.

Version:
$Revision$ $Date:: $
Author:
Fernando Esteban Barril Otero

Constructor Summary
RandomGenerator()
           
 
Method Summary
static RandomGenerator getInstance()
          Returns the RandomGenerator instance.
abstract  long getSeed()
          Returns the seed value which was used to initilise the random number generator.
abstract  double nextDouble()
          Returns the next pseudorandom double value between 0.0 and 1.0 from this random number generator's sequence.
abstract  int nextInt()
          Returns the next pseudorandom int value from this random number generator's sequence.
abstract  int nextInt(int n)
          Returns a pseudorandom int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomGenerator

public RandomGenerator()
Method Detail

getInstance

public static RandomGenerator getInstance()
Returns the RandomGenerator instance.

Returns:
the RandomGenerator instance.

nextDouble

public abstract double nextDouble()
Returns the next pseudorandom double value between 0.0 and 1.0 from this random number generator's sequence.

Returns:
the next pseudorandom double value between 0.0 and 1.0 from this random number generator's sequence.

nextInt

public abstract int nextInt()
Returns the next pseudorandom int value from this random number generator's sequence.

Returns:
the next pseudorandom int value from this random number generator's sequence.

nextInt

public abstract int nextInt(int n)
Returns a pseudorandom int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.

Parameters:
n - the upper bound on the random number to be returned.
Returns:
a pseudorandom int value between 0 (inclusive) and n (exclusive).

getSeed

public abstract long getSeed()
Returns the seed value which was used to initilise the random number generator.

Returns:
the seed value which was used to initilise the random number generator.


Copyright © 2013. All Rights Reserved.