Class IntProvider

    • Constructor Detail

      • IntProvider

        public IntProvider()
        Creates a new instance.
      • IntProvider

        protected IntProvider​(IntProvider source)
        Creates a new instance copying the state from the source.

        This provides base functionality to allow a generator to create a copy, for example for use in the JumpableUniformRandomProvider interface.

        Parameters:
        source - Source to copy.
        Since:
        1.3
    • Method Detail

      • resetCachedState

        protected void resetCachedState()
        Reset the cached state used in the default implementation of nextBoolean().

        This should be used when the state is no longer valid, for example after a jump performed for the JumpableUniformRandomProvider interface.

        Since:
        1.3
      • nextInt

        public int nextInt()
        Specified by:
        nextInt in interface org.apache.commons.rng.UniformRandomProvider
      • nextBoolean

        public boolean nextBoolean()
        Specified by:
        nextBoolean in interface org.apache.commons.rng.UniformRandomProvider
      • nextDouble

        public double nextDouble()
        Specified by:
        nextDouble in interface org.apache.commons.rng.UniformRandomProvider
      • nextLong

        public long nextLong()
        Specified by:
        nextLong in interface org.apache.commons.rng.UniformRandomProvider
      • nextBytes

        public void nextBytes​(byte[] bytes)
        Specified by:
        nextBytes in interface org.apache.commons.rng.UniformRandomProvider
      • nextBytes

        public void nextBytes​(byte[] bytes,
                              int start,
                              int len)
        Specified by:
        nextBytes in interface org.apache.commons.rng.UniformRandomProvider