Class SeedUtils.UnsignedByteProvider

  • Enclosing class:
    SeedUtils

    private static class SeedUtils.UnsignedByteProvider
    extends java.lang.Object
    Provider of unsigned 8-bit integers.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int bits
      The current 32-bits of randomness.
      private int counter
      The counter tracking the bits to extract.
      private static int MASK_2_BITS
      Mask to extract the lowest 2 bits from an integer.
      private static int MASK_8_BITS
      Mask to extract the lowest 8 bits from an integer.
      private UniformRandomProvider rng
      Source of randomness.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) int nextUnsignedByte()
      Return the next unsigned byte.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MASK_2_BITS

        private static final int MASK_2_BITS
        Mask to extract the lowest 2 bits from an integer.
        See Also:
        Constant Field Values
      • MASK_8_BITS

        private static final int MASK_8_BITS
        Mask to extract the lowest 8 bits from an integer.
        See Also:
        Constant Field Values
      • bits

        private int bits
        The current 32-bits of randomness.
      • counter

        private int counter
        The counter tracking the bits to extract.
    • Constructor Detail

      • UnsignedByteProvider

        UnsignedByteProvider​(UniformRandomProvider rng)
        Parameters:
        rng - Source of randomness.
    • Method Detail

      • nextUnsignedByte

        int nextUnsignedByte()
        Return the next unsigned byte.
        Returns:
        Value in the range[0,255]