public abstract class RandomUtils extends Object
| 构造器和说明 |
|---|
RandomUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
main(String[] args) |
static long |
random(long min,
long max)
Generates a random number from a specified range
|
static int |
randomSegment(int[] probability)
Returns the index of array that specifies probability.
|
static int |
randomSegment(String conf)
Returns a index of a specified probability, e.g. the string is "100:1:32:200:16:30".
|
static String |
randomString(int length)
Returns a random string.
|
public static long random(long min,
long max)
min - The minimal number of the rangemax - The maximal number of the rangepublic static int randomSegment(String conf)
conf - Configures specified probabilitypublic static int randomSegment(int[] probability)
probability - The element of array represents the probability.public static String randomString(int length)
length - The random string's lengthpublic static void main(String[] args)
Copyright © 2016. All rights reserved.