Description
Interface support
The RandomSource can be used to created instances that may implement JumpableUniformRandomProvider. This requires casting the returned value from the create method. Add methods to expose the interfaces supported by the provider without instantiation.
public boolean isJumpable(); public boolean isLongJumpable();
This will allow:
RandomSource source = ...;
if (source.isJumpable()) {
JumpableUniformRandomProvider rng =
(JumpableUniformRandomProvider) RandomSource.create(source);
}
Seed size
The internal components used to build the generators by RandomSource know the size of the seed required for the constructor. This can be exposed in a method:
public int getSeedByteSize();
This will allow:
RandomSource source = ...;
SecureRandom sr = new SecureRandom();
UniformRandomProvider rng = RandomSource.create(source,
sr.generateSeed(source.getSeedByteSize()));
Attachments
Issue Links
- is a parent of
-
RNG-117 RandomSource to support creating byte[] seed for implementing class.
- Closed
- links to