public class NumberSource extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static NumberSource |
getInstance()
获取唯一实例
|
double |
randomDouble(double startInclusive,
double endExclusive)
返回1个随机双精度数
|
double[] |
randomDouble(double startInclusive,
double endExclusive,
int count)
返回N个随机双精度数
|
int |
randomInt(int startInclusive,
int endExclusive)
返回1个随机整数
|
int[] |
randomInt(int startInclusive,
int endExclusive,
int count)
返回N个随机整数
|
long |
randomLong(long startInclusive,
long endExclusive)
返回1个随机长整数
|
long[] |
randomLong(long startInclusive,
long endExclusive,
int count)
返回N个随机长整数
|
public static NumberSource getInstance()
public int randomInt(int startInclusive,
int endExclusive)
startInclusive - 开始(含)endExclusive - 结束(不含)public int[] randomInt(int startInclusive,
int endExclusive,
int count)
startInclusive - 开始(含)endExclusive - 结束(不含)count - 随机整数个数public long randomLong(long startInclusive,
long endExclusive)
startInclusive - 开始(含)endExclusive - 结束(不含)public long[] randomLong(long startInclusive,
long endExclusive,
int count)
startInclusive - 开始(含)endExclusive - 结束(不含)count - 随机长整数个数public double randomDouble(double startInclusive,
double endExclusive)
startInclusive - 开始(含)endExclusive - 结束(不含)public double[] randomDouble(double startInclusive,
double endExclusive,
int count)
startInclusive - 开始(含)endExclusive - 结束(不含)count - 随机双精度数个数Copyright © 2021. All rights reserved.