public interface Random
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT |
static java.lang.String |
VERSION |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getRandomHex(int length)
returns a String of 2 x length
length containing a random
selection of uppercase hex characters. |
java.lang.String |
getRandomStringFromCharSet(char[] charset,
int length)
returns a String of length
length containing a random
selection of characters from charset |
boolean |
nextBoolean()
returns the next random boolean in the sequence
|
void |
nextBytes(byte[] bytes)
fills the supplied array of bytes with random bytes
|
double |
nextDouble()
returns the next random double in the sequence
|
float |
nextFloat()
returns the next random float in the sequence
|
double |
nextGaussian()
returns the next Gaussian random (normal distribution) double in the sequence
|
int |
nextInt()
returns the next random integer in the sequence
|
int |
nextInt(int n)
returns the next random integer (between 0 and n-1 inclusive) in the sequence
|
long |
nextLong()
returns the next random long in the sequence
|
static final java.lang.String VERSION
static final java.lang.String COPYRIGHT
boolean nextBoolean()
Random.nextBoolean()
void nextBytes(byte[] bytes)
bytes
- Random.nextBytes(byte[])
double nextDouble()
Random.nextDouble()
double nextGaussian()
Random.nextGaussian()
float nextFloat()
Random.nextFloat()
int nextInt()
Random.nextInt()
int nextInt(int n)
n
- exclusive upper limit for the random numbers returned.Random.nextInt(int n)
long nextLong()
Random.nextLong()
java.lang.String getRandomStringFromCharSet(char[] charset, int length)
length
containing a random
selection of characters from charset
charset
- An array of characters (does not require ordering, may contain duplicates)length
- The length of the returned random Stringjava.lang.String getRandomHex(int length)
length
containing a random
selection of uppercase hex characters. e.g. if length=4, returned
string is 8 characters longlength
- The length of the returned random hex String (x2 since hex is 2 chars per byte).Copyright © 2018 Pegasystems Inc. All Rights Reserved.