Class SeedUtils.UnsignedByteProvider
java.lang.Object
org.apache.commons.rng.simple.internal.SeedUtils.UnsignedByteProvider
- Enclosing class:
SeedUtils
Provider of unsigned 8-bit integers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
The current 32-bits of randomness.private int
The counter tracking the bits to extract.private static final int
Mask to extract the lowest 2 bits from an integer.private static final int
Mask to extract the lowest 8 bits from an integer.private final UniformRandomProvider
Source of randomness. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) int
Return the next unsigned byte.
-
Field Details
-
MASK_2_BITS
private static final int MASK_2_BITSMask to extract the lowest 2 bits from an integer.- See Also:
-
MASK_8_BITS
private static final int MASK_8_BITSMask to extract the lowest 8 bits from an integer.- See Also:
-
rng
Source of randomness. -
bits
private int bitsThe current 32-bits of randomness. -
counter
private int counterThe counter tracking the bits to extract.
-
-
Constructor Details
-
UnsignedByteProvider
UnsignedByteProvider(UniformRandomProvider rng) - Parameters:
rng
- Source of randomness.
-
-
Method Details
-
nextUnsignedByte
int nextUnsignedByte()Return the next unsigned byte.- Returns:
- Value in the range[0,255]
-