All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simula.random.RandomEngine

java.lang.Object
   |
   +----simula.random.RandomEngine

public abstract class RandomEngine
extends Object
The abstract class RandomEngine is the common parent of the entire hierarchy of the pseudo-random number generators. It riproduces the same interface as java.util.Random. The only thing required to have an effective pseudo-random generator is the implementation of the nextByte method. This hierarchy is widely inspired to that realized in July 1996 by John Walker, kelvin@fourmilab.ch.

See Also:
Random

Constructor Index

 o RandomEngine()

Method Index

 o nextBit()
Returns the next pseudo-random bit.
 o nextByte()
Returns the next pseudo-random byte.
 o nextByte(byte[])
Fills the entire given array with pseudo-random generated bytes.
 o nextByte(byte[], int)
Fills the given array with pseudo-random generated bytes.
 o nextDouble()
Returns the next pseudo-random double precision floating point value (according to a uniform distribution).
 o nextFloat()
Returns the next pseudo-random floating point value (according to a uniform distribution).
 o nextGaussian()
Returns the next pseudo-random value according to a normal distribution.
 o nextInt()
Returns the next pseudo-random integer value (according to a uniform distribution).
 o nextLong()
Returns the next pseudo-random long integer value (according to a uniform distribution).
 o nextShort()
Returns the next pseudo-random short integer value (according to a uniform distribution).
 o setSeed()
The change of seed must be notified to the super class from every child of RandomEngine.

Constructors

 o RandomEngine
 public RandomEngine()

Methods

 o nextBit
 public boolean nextBit()
Returns the next pseudo-random bit.

Returns:
the next pseudo-random bit.
 o nextByte
 public abstract byte nextByte()
Returns the next pseudo-random byte.

Returns:
the next pseudo-random byte.
 o nextByte
 public void nextByte(byte buf[])
Fills the entire given array with pseudo-random generated bytes.

Parameters:
buf - Array to fill.
 o nextByte
 public void nextByte(byte buf[],
                      int buflen)
Fills the given array with pseudo-random generated bytes.

Parameters:
buf - Array of at least byte to fill.
buflen - Number of bytes to store.
 o nextDouble
 public double nextDouble()
Returns the next pseudo-random double precision floating point value (according to a uniform distribution).

Returns:
the next pseudo-random double precision floating point value (according to a uniform distribution).
 o nextFloat
 public float nextFloat()
Returns the next pseudo-random floating point value (according to a uniform distribution).

Returns:
the next pseudo-random floating point value (according to a uniform distribution).
 o nextGaussian
 public double nextGaussian()
Returns the next pseudo-random value according to a normal distribution.

Returns:
the next pseudo-random value according to a normal distribution.
 o nextInt
 public int nextInt()
Returns the next pseudo-random integer value (according to a uniform distribution).

Returns:
the next pseudo-random integer value (according to a uniform distribution).
 o nextLong
 public long nextLong()
Returns the next pseudo-random long integer value (according to a uniform distribution).

Returns:
the next pseudo-random long integer value (according to a uniform distribution).
 o nextShort
 public short nextShort()
Returns the next pseudo-random short integer value (according to a uniform distribution).

Returns:
the next pseudo-random short integer value (according to a uniform distribution).
 o setSeed
 public void setSeed()
The change of seed must be notified to the super class from every child of RandomEngine.


All Packages  Class Hierarchy  This Package  Previous  Next  Index