jtge.util.random
Class Random

java.lang.Object
  extended byjava.util.Random
      extended byjtge.util.random.Random
All Implemented Interfaces:
IRandom, java.io.Serializable

public class Random
extends java.util.Random
implements IRandom

An instance of this class is used to generate a stream of pseudorandom numbers. Its basically a wrapper for java.util.Random class with more high-level functionalities.

The behavior is stricly the same as java.util.Random, which is used internally.

Version:
$Revision: 1.4 $ $Date: 2005/09/10 14:05:52 $
Author:
jeanlaurent
See Also:
Serialized Form

Constructor Summary
Random()
          Builds a default Random Object.
Random(long seed)
           
 
Method Summary
 long getSeed()
          Returns the current seed used by this Random object.
 float nextFloat(float maxVal)
          Returns a float in the range [0.0, maxVal[.
 void setSeed(long seed)
           
 
Methods inherited from class java.util.Random
next, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jtge.util.random.IRandom
nextInt
 

Constructor Detail

Random

public Random()
Builds a default Random Object.

See Also:
Random.Random()

Random

public Random(long seed)
Parameters:
seed - the initial seed
See Also:
Random.Random(long)
Method Detail

setSeed

public final void setSeed(long seed)
See Also:
Random.setSeed(long)

getSeed

public final long getSeed()
Returns the current seed used by this Random object.

Returns:
the current seed used by this Random object.

nextFloat

public final float nextFloat(float maxVal)
Returns a float in the range [0.0, maxVal[.

This method is implemented as :

 return nextFloat() * maxVal;
 

Specified by:
nextFloat in interface IRandom
Parameters:
maxVal - the maximum value
Returns:
float
See Also:
Random.nextFloat()


Copyright © 2003-2005 . All Rights Reserved.