| 
 | JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jgap.util.randomX
public abstract class randomX
Abstract superclass for emulations of java.util.Random with various underlying generators. These generators provide a superset of the methods of the built-in Java generator, and allow easy replacement of the low-level byte-stream random generator without the need to reimplement the higher-level calls.
The nature of the data returned by the functions in this class depends upon the generator provided by the class derived from it. If the generator is algorithmic, the data are pseudorandom; if a hardware generator is employed, genuine random data may be obtained. For brevity, in this document, we use random to refer to the data returned, whatever its actual source.
Designed and implemented in July 1996 by John Walker, kelvin@fourmilab.ch.
Random| Constructor Summary | |
|---|---|
| randomX() | |
| Method Summary | |
|---|---|
|  boolean | nextBit() | 
| abstract  byte | nextByte()Return next [pseudo]random byte from low level generator. | 
|  void | nextByte(byte[] buf)Fill an array of bytes with random data. | 
|  void | nextByte(byte[] buf,
         int buflen)Fill a portion of an array of bytes with random data. | 
|  double | nextDouble() | 
|  float | nextFloat() | 
|  double | nextGaussian() | 
|  int | nextInt() | 
|  long | nextLong() | 
|  short | nextShort() | 
|  void | setSeed()Reset when seed changes. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public randomX()
| Method Detail | 
|---|
public void setSeed()
If a derived class does not permit specification of a seed (hardware-based generators, for example), it should declare:
private void setSeed(long seed) { }
which will hide the setSeed method from its users and cause a compile-time error if a program attempts to specify a seed.
public abstract byte nextByte()
public int nextInt()
public long nextLong()
public float nextFloat()
public double nextDouble()
public double nextGaussian()
public boolean nextBit()
public void nextByte(byte[] buf,
                     int buflen)
buf - array of byte to fill.buflen - number of bytes to store.public void nextByte(byte[] buf)
buf - array of bytes to fill.public short nextShort()
| 
 | JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||