Package org.apache.commons.rng
Interface RestorableUniformRandomProvider
-
- All Superinterfaces:
UniformRandomProvider
public interface RestorableUniformRandomProvider extends UniformRandomProvider
Applies to generators whose internal state can be saved and restored.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
restoreState(RandomProviderState state)
Restores the state of a generator.RandomProviderState
saveState()
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
restore
method. - Throws:
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 tosaveState
performed either on the same object as this one, or an object of the exact same class.- Throws:
UnsupportedOperationException
- if the underlying source of randomness does not support this functionality.IllegalArgumentException
- if it was detected that thestate
argument is incompatible with this instance.
-
-