public class Random extends Object
Constructor and Description |
---|
Random()
Constructs the random value generator.
|
Random(long seed)
Constructs the random value generators with a seed.
|
Modifier and Type | Method and Description |
---|---|
double |
drandom(double x,
double y)
Selects a double random number uniformly distributed between x and y,
inclusively, with a mean of (x+y)/2.
|
long |
lrandom(long x,
long y)
Selects a long random number uniformly distributed between x and y,
inclusively, with a mean of (x+y)/2.
|
String |
makeAString(int x,
int y)
makeAString [x..y] generates a random string of alphanumeric
characters of random lengthof mininum x, maximum y and mean (x+y)/2
|
Calendar |
makeCalendarInInterval(Calendar min,
Calendar max)
Creates a random calendar between Calendar min and max.
|
Calendar |
makeCalendarInInterval(Calendar ref,
int min,
int max,
int units)
Creates a random calendar between time ref + min and ref + max.
|
String |
makeCString(int x,
int y)
makeCString [x..y] generates a random string of only alpahabet
characters of random length of mininum x, maximum y and
mean (x+y)/2
|
Date |
makeDateInInterval(Date inDate,
int x,
int y)
makeDateInInterval generates a java.sql.Date instance representing
a Date within the range specified by (input Date + x) and
(inputDate + y)
|
String |
makeNString(int x,
int y)
makeNString [x..y] generates a random string of only numeric
characters of random length of mininum x, maximum y and
mean (x+y)/2.
|
int |
NURand(int A,
int x,
int y)
NURand integer non-uniform random number generator.
|
int |
random(int x,
int y)
Selects a random number uniformly distributed between x and y,
inclusively, with a mean of (x+y)/2.
|
public Random()
public Random(long seed)
seed
- The seed for the random value generatorpublic int random(int x, int y)
x
- the x valuey
- the y valuepublic long lrandom(long x, long y)
x
- the x valuey
- the y valuepublic double drandom(double x, double y)
x
- the x valuey
- the y valuepublic int NURand(int A, int x, int y)
A
- the A valuex
- the x valuey
- the y valuepublic String makeAString(int x, int y)
x
- the minimum lengthy
- the maximum lengthpublic String makeCString(int x, int y)
x
- the minimum lengthy
- the maximum lengthpublic Date makeDateInInterval(Date inDate, int x, int y)
inDate
- the reference datex
- minimum offset from the reference datey
- maximum offset from the reference datepublic Calendar makeCalendarInInterval(Calendar ref, int min, int max, int units)
ref
- The reference calendarmin
- The lower time offset from refmax
- The upper time offset from refunits
- The units of min and max, referencing the
fields of Calendar, e.g. Calendar.YEARpublic Calendar makeCalendarInInterval(Calendar min, Calendar max)
min
- The minimum timemax
- The maximum timepublic String makeNString(int x, int y)
x
- the minimum lengthy
- the maximum length