hex.rng
Class XorShiftRNG

java.lang.Object
  extended by java.util.Random
      extended by hex.rng.XorShiftRNG
All Implemented Interfaces:
java.io.Serializable

public class XorShiftRNG
extends java.util.Random

Simple XorShiftRNG. Note: According to RF benchmarks it does not provide so accurate results as Random, however it can be used as an alternative.

See Also:
Serialized Form

Constructor Summary
XorShiftRNG(long seed)
           
 
Method Summary
protected  int next(int bits)
           
 int nextInt()
           
 int nextInt(int n)
           
 long nextLong()
           
 
Methods inherited from class java.util.Random
nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, setSeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XorShiftRNG

public XorShiftRNG(long seed)
Method Detail

nextLong

public long nextLong()
Overrides:
nextLong in class java.util.Random

nextInt

public int nextInt()
Overrides:
nextInt in class java.util.Random

nextInt

public int nextInt(int n)
Overrides:
nextInt in class java.util.Random

next

protected int next(int bits)
Overrides:
next in class java.util.Random