类 RandomUtils


  • public class RandomUtils
    extends java.lang.Object
    Random utils.
    作者:
    zzq
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      private static java.util.Random RANDOM
      Random Object for random method.
    • 构造器概要

      构造器 
      构造器 说明
      RandomUtils()  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      private static void checkParameters​(long startInclusive, long endExclusive)
      Check input parameters.
      static int nextInt​(int startInclusive, int endExclusive)
      Returns a random integer within the specified range.
      static long nextLong​(long startInclusive, long endExclusive)
      Returns a random long within the specified range.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • RANDOM

        private static final java.util.Random RANDOM
        Random Object for random method.
    • 构造器详细资料

      • RandomUtils

        public RandomUtils()
    • 方法详细资料

      • nextLong

        public static long nextLong​(long startInclusive,
                                    long endExclusive)
        Returns a random long within the specified range.
        参数:
        startInclusive - the smallest value that can be returned, must be non-negative
        endExclusive - the upper bound (not included)
        返回:
        the random long
        抛出:
        java.lang.IllegalArgumentException - if startInclusive or endExclusive illegal
      • nextInt

        public static int nextInt​(int startInclusive,
                                  int endExclusive)
        Returns a random integer within the specified range.
        参数:
        startInclusive - lower limit, must be non-negative
        endExclusive - the upper bound (not included)
        返回:
        the random integer
        抛出:
        java.lang.IllegalArgumentException - if startInclusive or endExclusive illegal
      • checkParameters

        private static void checkParameters​(long startInclusive,
                                            long endExclusive)
        Check input parameters.
        参数:
        startInclusive - lower limit, must be non-negative
        endExclusive - the upper bound (not included)