Package org.apache.commons.rng
Interface RestorableUniformRandomProvider
-
- All Superinterfaces:
UniformRandomProvider
- All Known Implementing Classes:
AbstractWell,BaseProvider,IntProvider,ISAACRandom,JDKRandom,KISSRandom,LongProvider,MersenneTwister,MersenneTwister64,MultiplyWithCarry256,SplitMix64,TwoCmres,Well1024a,Well19937a,Well19937c,Well44497a,Well44497b,Well512a,XoRoShiRo128Plus,XoRoShiRo128StarStar,XoRoShiRo64Star,XoRoShiRo64StarStar,XorShift1024Star,XorShift1024StarPhi,XoShiRo128Plus,XoShiRo128StarStar,XoShiRo256Plus,XoShiRo256StarStar,XoShiRo512Plus,XoShiRo512StarStar
public interface RestorableUniformRandomProvider extends UniformRandomProvider
Applies to generators whose internal state can be saved and restored.- Since:
- 1.0
-
-
Method Summary
Modifier and Type Method Description voidrestoreState(RandomProviderState state)Restores the state of a generator.RandomProviderStatesaveState()Saves the state of a generator.-
Methods inherited from interface org.apache.commons.rng.UniformRandomProvider
nextBoolean, nextBytes, nextBytes, nextDouble, nextFloat, nextInt, nextInt, nextLong, nextLong
-
-
-
-
Method Detail
-
saveState
RandomProviderState saveState()
Saves the state of a generator.- Returns:
- the current state of this instance. It is a value that can
subsequently be passed to the
restoremethod. - Throws:
java.lang.UnsupportedOperationException- if the underlying source of randomness does not support this functionality.
-
restoreState
void restoreState(RandomProviderState state)
Restores the state of a generator.- Parameters:
state- State which this instance will be set to. This parameter would usually have been obtained by a call tosaveStateperformed either on the same object as this one, or an object of the exact same class.- Throws:
java.lang.UnsupportedOperationException- if the underlying source of randomness does not support this functionality.java.lang.IllegalArgumentException- if it was detected that thestateargument is incompatible with this intance.
-
-