|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.test.synth.sql.RandomGen
public class RandomGen
A random data generator class.
Constructor Summary | |
---|---|
RandomGen()
Create a new random instance with a fixed seed value. |
Method Summary | |
---|---|
boolean |
getBoolean(int percent)
Get a boolean that is true with the given probability in percent. |
byte[] |
getByteArray()
Get a random byte array. |
void |
getBytes(byte[] data)
Get a number of random bytes. |
int |
getInt(int max)
Get the next integer that is smaller than max. |
int[] |
getIntArray()
Get a random integer array. |
int |
getLog(int max)
Get the next random value that is at most max but probably much lower. |
double |
getRandomDouble()
Get a random double. |
int |
getRandomInt()
Get a random integer. |
long |
getRandomLong()
Get a random long. |
java.lang.String |
modify(java.lang.String sql)
Randomly modify a SQL statement. |
boolean |
nextBoolean()
Get a random boolean. |
double |
nextGaussian()
Get the next gaussian value. |
java.sql.Date |
randomDate()
Get a random date value. |
java.lang.String |
randomString(int len)
Get a random string with the given length. |
java.sql.Time |
randomTime()
Get a random time value. |
java.sql.Timestamp |
randomTimestamp()
Get a random timestamp value. |
void |
setSeed(int seed)
Set the seed value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RandomGen()
Method Detail |
---|
public int getInt(int max)
max
- the upper limit (exclusive)
public double nextGaussian()
public int getLog(int max)
max
- the maximum value
public void getBytes(byte[] data)
data
- the target bufferpublic boolean getBoolean(int percent)
percent
- the probability
public java.lang.String randomString(int len)
len
- the length
public int getRandomInt()
public long getRandomLong()
public double getRandomDouble()
public boolean nextBoolean()
public int[] getIntArray()
public byte[] getByteArray()
public java.sql.Time randomTime()
public java.sql.Timestamp randomTimestamp()
public java.sql.Date randomDate()
public java.lang.String modify(java.lang.String sql)
sql
- the original SQL statement
public void setSeed(int seed)
seed
- the new seed value
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |