Package jadex.ipc.impl.security.random
Class SecureThreadedRandom
java.lang.Object
java.util.Random
java.security.SecureRandom
jadex.ipc.impl.security.random.SecureThreadedRandom
- All Implemented Interfaces:
Serializable,RandomGenerator
Wrapper for quick multi-threaded PRNG access using multiple PRNGs.
- 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 TypeFieldDescriptionprotected SecureRandom[]The random number generators.protected intMask for distributing threads. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]generateSeed(int numbytes) Generates a seed value from OS source.booleanWrapper method.voidnextBytes(byte[] bytes) Wrapper method.doubleWrapper method.floatWrapper method.doubleWrapper method.intnextInt()Wrapper method.intnextInt(int bound) Wrapper method.longnextLong()Wrapper method.voidsetSeed(long seed) Wrapper method.Methods inherited from class java.security.SecureRandom
getAlgorithm, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstanceStrong, getParameters, getProvider, getSeed, next, nextBytes, reseed, reseed, setSeed, toStringMethods inherited from class java.util.Random
doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.random.RandomGenerator
isDeprecated, nextDouble, nextDouble, nextExponential, nextFloat, nextFloat, nextGaussian, nextInt, nextLong, nextLong
-
Field Details
-
prngs
The random number generators. -
threadingmask
protected int threadingmaskMask for distributing threads.
-
-
Constructor Details
-
SecureThreadedRandom
public SecureThreadedRandom()Creates the wrapper.
-
-
Method Details
-
nextBoolean
public boolean nextBoolean()Wrapper method.- Specified by:
nextBooleanin interfaceRandomGenerator- Overrides:
nextBooleanin classRandom
-
nextBytes
public void nextBytes(byte[] bytes) Wrapper method.- Specified by:
nextBytesin interfaceRandomGenerator- Overrides:
nextBytesin classSecureRandom
-
nextDouble
public double nextDouble()Wrapper method.- Specified by:
nextDoublein interfaceRandomGenerator- Overrides:
nextDoublein classRandom
-
nextFloat
public float nextFloat()Wrapper method.- Specified by:
nextFloatin interfaceRandomGenerator- Overrides:
nextFloatin classRandom
-
nextGaussian
public double nextGaussian()Wrapper method.- Specified by:
nextGaussianin interfaceRandomGenerator- Overrides:
nextGaussianin classRandom
-
nextInt
public int nextInt()Wrapper method.- Specified by:
nextIntin interfaceRandomGenerator- Overrides:
nextIntin classRandom
-
nextInt
public int nextInt(int bound) Wrapper method.- Specified by:
nextIntin interfaceRandomGenerator- Overrides:
nextIntin classRandom
-
nextLong
public long nextLong()Wrapper method.- Specified by:
nextLongin interfaceRandomGenerator- Overrides:
nextLongin classRandom
-
generateSeed
public byte[] generateSeed(int numbytes) Generates a seed value from OS source.- Overrides:
generateSeedin classSecureRandom
-
setSeed
public void setSeed(long seed) Wrapper method. Warning: This is useless, included for completeness.- Overrides:
setSeedin classSecureRandom
-