BenchCRandom

The random data generator used for BenchC.

Methods
String[] getAddress()
Get random address data.
String[] getAddress()
Get random address data.
Returns:
the address
BigDecimal getBigDecimal(int value, int scale)
Create a big decimal value.
BigDecimal getBigDecimal(int value, int scale)
Create a big decimal value.
Parameters:
value - the value
scale - the scale
Returns:
the big decimal object
boolean[] getBoolean(int length, int trueCount)
Generate a boolean array with this many items set to true (randomly distributed).
boolean[] getBoolean(int length, int trueCount)
Generate a boolean array with this many items set to true (randomly distributed).
Parameters:
length - the size of the array
trueCount - the number of true elements
Returns:
the boolean array
int getInt(int min, int max)
Get a random integer value between min and max.
int getInt(int min, int max)
Get a random integer value between min and max.
Parameters:
min - the minimum value
max - the maximum value
Returns:
the random value
String getLastname(int i)
Generate a last name composed of three elements
String getLastname(int i)
Generate a last name composed of three elements
Parameters:
i - the last name index
Returns:
the name
int getNonUniform(int a, int min, int max)
Get a non-uniform random integer value between min and max.
int getNonUniform(int a, int min, int max)
Get a non-uniform random integer value between min and max.
Parameters:
a - the bit mask
min - the minimum value
max - the maximum value
Returns:
the random value
String getNumberString(int min, int max)
Get a random number string.
String getNumberString(int min, int max)
Get a random number string.
Parameters:
min - the minimum value
max - the maximum value
Returns:
the number string
int[] getPermutation(int length)
Generate a random permutation if the values 0 ..
int[] getPermutation(int length)
Generate a random permutation if the values 0 .. length.
Parameters:
length - the number of elements
Returns:
the random permutation
String getString(int min, int max)
Get a random string.
String getString(int min, int max)
Get a random string.
Parameters:
min - the minimum size
max - the maximum size
Returns:
the string
String getString(int len)
Get a random string.
String getString(int len)
Get a random string.
Parameters:
len - the size
Returns:
the string
String replace(String text, String replacement)
Replace a random part of the string with another text.
String replace(String text, String replacement)
Replace a random part of the string with another text.
Parameters:
text - the original text
replacement - the replacement
Returns:
the patched string