Package com.hypixel.hytale.math.util
Class FastRandom
java.lang.Object
java.util.Random
com.hypixel.hytale.math.util.FastRandom
- All Implemented Interfaces:
Serializable,RandomGenerator
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.random.RandomGenerator
RandomGenerator.ArbitrarilyJumpableGenerator, RandomGenerator.JumpableGenerator, RandomGenerator.LeapableGenerator, RandomGenerator.SplittableGenerator, RandomGenerator.StreamableGenerator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate static final longprivate static final longprivate long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static longinitialScramble(long seed) protected intnext(int bits) doublevoidsetSeed(long seed) Methods inherited from class java.util.Random
doubles, doubles, doubles, doubles, from, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextBytes, nextDouble, nextFloat, nextInt, nextInt, nextLongMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.random.RandomGenerator
isDeprecated, nextDouble, nextDouble, nextExponential, nextFloat, nextFloat, nextGaussian, nextInt, nextLong, nextLong
-
Field Details
-
multiplier
private static final long multiplier- See Also:
-
addend
private static final long addend- See Also:
-
mask
private static final long mask- See Also:
-
seed
private long seed
-
-
Constructor Details
-
FastRandom
public FastRandom() -
FastRandom
public FastRandom(long seed)
-
-
Method Details
-
setSeed
public void setSeed(long seed) -
initialScramble
private static long initialScramble(long seed) -
next
protected int next(int bits) -
nextGaussian
public double nextGaussian()- Specified by:
nextGaussianin interfaceRandomGenerator- Overrides:
nextGaussianin classRandom
-