public final class RandomPrimitivesExtensions extends Object
| Constructor and Description |
|---|
RandomPrimitivesExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getRandomIntBetween(int minVolume,
int maxVolume)
Returns a random int between the range from minVolume and maxVolume with the
Math.abs method. |
static boolean |
randomBoolean()
Returns a random boolean.
|
static byte |
randomByte()
The Method randomByte() selects a random byte.
|
static byte[] |
randomByteArray(int length)
The Method randomByteArray(int) generates a random byte array.
|
static char |
randomChar()
Returns a random char.
|
static char |
randomChar(String string)
The Method randomChar(String) selects a random char from the given String.
|
static double |
randomDouble()
The Method randomDouble() gets a random double
|
static double |
randomDouble(double range)
The Method randomDouble(double) gets an double to the spezified range.
|
static double |
randomDoubleBetween(double start,
double end)
Gets the random double between the range from start and end.
|
static double |
randomDoubleBetween(double start,
double end,
String pattern)
Gets the random double between the range from start and end in the given pattern.
|
static float |
randomFloat()
Generates a random float between the range 0.0-9.9.
|
static float |
randomFloat(float range)
The Method randomFloat(float) gets an float to the spezified range.
|
static float |
randomFloat(int afterComma,
int beforeComma)
The Method getRandomFloat(int,int) gets an random float.
|
static float |
randomFloatBetween(float start,
float end)
Gets the random float between the range from start and end.
|
static float |
randomFloatBetween(float start,
float end,
String pattern)
Gets the random float between the range from start and end in the given pattern.
|
static int |
randomInt()
The Method randomInt() gets an int between the range 0-9.
|
static int |
randomInt(int range)
The Method randomInt(int) gets an int to the spezified range.
|
static int |
randomIntBetween(int start,
int end)
Returns a random int between the range from start and end.
|
static int |
randomIntBetween(int start,
int end,
boolean includeMin,
boolean includeMax)
Returns a random int between the range from start and end.
|
static long |
randomLong()
Gets a random long
|
static long |
randomLong(long range)
The Method randomLong(long) gets an long to the spezified range.
|
static long |
randomLongBetween(long start,
long end)
Returns a random long between the range from start and end.
|
static short |
randomShort()
Returns a random short
|
public static boolean randomBoolean()
public static byte randomByte()
public static byte[] randomByteArray(int length)
length - the length.public static char randomChar()
public static short randomShort()
public static char randomChar(String string)
string - The String from who to select the char.public static long randomLong()
public static long randomLong(long range)
range - the rangepublic static long randomLongBetween(long start,
long end)
start - The long from where the range starts.end - The long from where the range ends.public static float randomFloat()
public static double randomDouble(double range)
range - the rangepublic static double randomDouble()
public static double randomDoubleBetween(double start,
double end)
start - the startend - the endpublic static double randomDoubleBetween(double start,
double end,
String pattern)
throws ParseException
DecimalFormat.start - the startend - the endpattern - the patternParseException - is thrown if the beginning of the specified string cannot be parsedpublic static float randomFloat(float range)
range - the rangepublic static float randomFloat(int afterComma,
int beforeComma)
afterComma - How many decimal places after the comma.beforeComma - How many decimal places before the comma.public static float randomFloatBetween(float start,
float end)
start - the startend - the endpublic static float randomFloatBetween(float start,
float end,
String pattern)
throws ParseException
DecimalFormat.start - the startend - the endpattern - the patternParseException - is thrown if the beginning of the specified string cannot be parsedpublic static int randomInt()
public static int randomInt(int range)
range - The Range.public static int randomIntBetween(int start,
int end)
start - The int from where the range starts.end - The int from where the range ends.public static int randomIntBetween(int start,
int end,
boolean includeMin,
boolean includeMax)
start - The int from where the range starts.end - The int from where the range ends.includeMin - if true than min value is includedincludeMax - if true than max value is includedpublic static int getRandomIntBetween(int minVolume,
int maxVolume)
Math.abs method.minVolume - the min volumemaxVolume - the max volumeCopyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.