public final class RandomUtils
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
RandomUtils() |
Modifier and Type | Method and Description |
---|---|
static java.util.Collection<java.lang.Integer> |
generateSequence(int lowerInclusiveBound,
int upperInclusiveBound,
int sequenceLength)
Generates a sequence of random numbers with a given parameters.
|
static java.util.Collection<java.lang.Integer> |
generateSequence(int lowerInclusiveBound,
int upperInclusiveBound,
int sequenceLength,
java.util.Collection<java.lang.Integer> restrictedValues)
Generates a sequence of random numbers with a given parameters.
|
static int |
nextInt(int upperExclusiveBound,
java.util.Collection<java.lang.Integer> restrictedValues) |
static int |
nextInt(int upperExclusiveBound,
int restrictedValue) |
static int |
nextInt(int lowerInclusiveBound,
int upperExclusiveBound,
java.util.Collection<java.lang.Integer> restrictedValues) |
static int |
nextInt(int lowerInclusiveBound,
int upperExclusiveBound,
int restrictedValue) |
private static int |
nextInt(java.util.Random rand,
int lowerInclusiveBound,
int upperExclusiveBound,
java.util.Set<java.lang.Integer> restricted) |
public static java.util.Collection<java.lang.Integer> generateSequence(int lowerInclusiveBound, int upperInclusiveBound, int sequenceLength)
Generates a sequence of random numbers with a given parameters.
lowerInclusiveBound
- the lower inclusive bound of a sequenceupperInclusiveBound
- the upper inclusive bound of a sequencesequenceLength
- the result sequence lengthpublic static java.util.Collection<java.lang.Integer> generateSequence(int lowerInclusiveBound, int upperInclusiveBound, int sequenceLength, java.util.Collection<java.lang.Integer> restrictedValues)
Generates a sequence of random numbers with a given parameters.
lowerInclusiveBound
- the lower inclusive bound of a sequenceupperInclusiveBound
- the upper inclusive bound of a sequencesequenceLength
- the result sequence lengthrestrictedValues
- the restricted numbers which cannot appear in the result sequencepublic static int nextInt(int upperExclusiveBound, int restrictedValue)
public static int nextInt(int upperExclusiveBound, java.util.Collection<java.lang.Integer> restrictedValues)
public static int nextInt(int lowerInclusiveBound, int upperExclusiveBound, int restrictedValue)
public static int nextInt(int lowerInclusiveBound, int upperExclusiveBound, java.util.Collection<java.lang.Integer> restrictedValues)
private static int nextInt(java.util.Random rand, int lowerInclusiveBound, int upperExclusiveBound, java.util.Set<java.lang.Integer> restricted)