Class XORShiftRandom
java.lang.Object
java.util.Random
net.demilich.metastone.game.logic.XORShiftRandom
- All Implemented Interfaces:
Serializable
,Cloneable
,RandomGenerator
A non-thread-safe random number generator that uses the "XOR Shift" pattern to produce numbers.
This instance is serializable and cloneable. It can be used to reproducibly create sequences of random numbers.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
Nested classes/interfaces inherited from interface java.util.random.RandomGenerator
RandomGenerator.ArbitrarilyJumpableGenerator, RandomGenerator.JumpableGenerator, RandomGenerator.LeapableGenerator, RandomGenerator.SplittableGenerator, RandomGenerator.StreamableGenerator
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.Random
doubles, doubles, doubles, doubles, from, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeed
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.random.RandomGenerator
isDeprecated, nextDouble, nextDouble, nextExponential, nextFloat, nextFloat, nextGaussian, nextInt, nextLong, nextLong
-
Constructor Details
-
XORShiftRandom
public XORShiftRandom(long state)
-
-
Method Details
-
createSeed
public static long createSeed()Creates a valid, highly probably unique seed. -
next
protected int next(int nbits) -
clone
-
getState
public long getState() -
setState
-