public final class RandomUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static float |
randomFloat(float start,
float end)
随机浮点数(包含边界)
|
static float |
randomFloat(Random random,
float start,
float end)
随机浮点数(包含边界)
|
static float |
randomFloatSecure(float start,
float end) |
static int |
randomInt(int min,
int max)
随机整数(包含边界值)
|
static int |
randomInt(Random random,
int start,
int end)
随机整数(包含边界值)
|
static int |
randomIntSecure(int min,
int max) |
static long |
randomLong(long start,
long end)
返回long型(包含边界)
|
static long |
randomLong(Random random,
long start,
long end)
返回long型(包含边界)
|
static long |
randomLongSecure(long start,
long end) |
static int |
randomOne()
返回1或-1
|
static int |
randomOne(Random random)
返回1或-1
|
static int |
randomOneSecure() |
static int |
randomWeight(int[] weight) |
public static int randomInt(int min,
int max)
min - max - public static int randomIntSecure(int min,
int max)
public static int randomInt(Random random, int start, int end)
min - max - public static long randomLong(long start,
long end)
start - end - public static long randomLongSecure(long start,
long end)
public static long randomLong(Random random, long start, long end)
random - start - end - public static float randomFloat(float start,
float end)
start - end - public static float randomFloatSecure(float start,
float end)
public static float randomFloat(Random random, float start, float end)
random - start - end - public static int randomOne()
public static int randomOneSecure()
public static int randomOne(Random random)
public static int randomWeight(int[] weight)
Copyright © 2017. All rights reserved.