Class CRandomUtil.Int

  • Enclosing class:
    CRandomUtil

    public static class CRandomUtil.Int
    extends java.lang.Object
    Random generator functions to generate random Integer values.
    • Constructor Summary

      Constructors 
      Constructor Description
      Int()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getNext()
      Returns a random int within 0 - Integer.MAX_VALUE
      static int getNext​(int startInclusive, int endExclusive)
      Returns a random integer within the specified range.
      • Methods inherited from class java.lang.Object

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

      • Int

        public Int()
    • Method Detail

      • getNext

        public static int getNext​(int startInclusive,
                                  int endExclusive)

        Returns a random integer within the specified range.

        Parameters:
        startInclusive - the smallest value that can be returned, must be non-negative
        endExclusive - the upper bound (not included)
        Returns:
        the random integer
        Throws:
        java.lang.IllegalArgumentException - if startInclusive > endExclusive or if startInclusive is negative
      • getNext

        public static int getNext()

        Returns a random int within 0 - Integer.MAX_VALUE

        Returns:
        the random integer
        See Also:
        getNext(int, int)