public class MiscRandom
extends java.lang.Object
Constructor and Description |
---|
MiscRandom() |
Modifier and Type | Method and Description |
---|---|
static java.util.Random |
getRandom()
Get the singleton instance of Random used by this application.
|
static double |
getRandomDouble(double minVal,
double maxVal)
Get random double >= minVal and <= maxVal.
|
static int |
getRandomInt(int minVal,
int maxVal)
Get random integer >= minVal and < maxVal.
|
static long |
seedRandomNumberGenerator()
Seed the random number generator with the current data and time.
|
static long |
seedRandomNumberGenerator(long seed)
Seed the random number generator with a known value.
|
public static java.util.Random getRandom()
public static int getRandomInt(int minVal, int maxVal)
minVal
- The result will be >= this value.maxVal
- The result will be < this value.public static double getRandomDouble(double minVal, double maxVal)
minVal
- The result will be >= this value.maxVal
- The result will be <= this value.public static long seedRandomNumberGenerator()
public static long seedRandomNumberGenerator(long seed)