Class DiscreteUniformGenerator

  • All Implemented Interfaces:
    NumberGenerator<java.lang.Integer>

    public class DiscreteUniformGenerator
    extends java.lang.Object
    implements NumberGenerator<java.lang.Integer>
    Discrete, uniformly distributed random sequence. Generates values between the specified minimum and maximum values (inclusive).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int minimumValue  
      private int range  
      private java.util.Random rng  
    • Constructor Summary

      Constructors 
      Constructor Description
      DiscreteUniformGenerator​(int minimumValue, int maximumValue, java.util.Random rng)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Integer nextValue()
      • Methods inherited from class java.lang.Object

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

      • rng

        private final java.util.Random rng
      • range

        private final int range
      • minimumValue

        private final int minimumValue
    • Constructor Detail

      • DiscreteUniformGenerator

        public DiscreteUniformGenerator​(int minimumValue,
                                        int maximumValue,
                                        java.util.Random rng)
    • Method Detail

      • nextValue

        public java.lang.Integer nextValue()
        Specified by:
        nextValue in interface NumberGenerator<java.lang.Integer>
        Returns:
        The next value from the generator.