Package de.alpharogroup.random.number
Class RandomPrimitivesFactory
- java.lang.Object
-
- de.alpharogroup.random.number.RandomPrimitivesFactory
-
public final class RandomPrimitivesFactory extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanrandomBoolean(java.security.SecureRandom secureRandom)Returns a random boolean.static byterandomByte(java.security.SecureRandom secureRandom)The Method randomByte() selects a random byte.static byte[]randomByteArray(int length, java.security.SecureRandom secureRandom)The Method randomByteArray(int) generates a random byte array.static charrandomChar(java.security.SecureRandom secureRandom)Returns a random char.static doublerandomDouble(double range, de.alpharogroup.random.enums.RandomAlgorithm algorithm, java.security.SecureRandom secureRandom)Gets an random double to the given range with the given random algorithm
For example: if you put range to 10 the random float is between 0.0-9.9static doublerandomDouble(double range, java.security.SecureRandom secureRandom)Gets an random double to the given range with the given random algorithm
For example: if you put range to 10 the random float is between 0.0-9.9static doublerandomDouble(java.security.SecureRandom secureRandom)Gets an random double to the given range with the given random algorithm
For example: if you put range to 10 the random float is between 0.0-9.9static doublerandomDoubleBetween(double start, double end, java.security.SecureRandom secureRandom)Gets the random double between the range from start and end.static floatrandomFloat(float range, de.alpharogroup.random.enums.RandomAlgorithm algorithm, java.security.SecureRandom secureRandom)Gets an random float to the given range with the given random algorithm
For example: if you put range to 10 the random float is between 0.0-9.9static floatrandomFloat(float range, java.security.SecureRandom secureRandom)Gets an random float to the given range with the given random algorithm
For example: if you put range to 10 the random float is between 0.0-9.9static floatrandomFloat(java.security.SecureRandom secureRandom)Generates a random float between the range 0.0-9.9.static floatrandomFloatBetween(float start, float end, java.security.SecureRandom secureRandom)Gets the random float between the range from start and end.static intrandomInt(int range, de.alpharogroup.random.enums.RandomAlgorithm algorithm, java.security.SecureRandom secureRandom)The Method randomInt(int) gets an int to the spezified range.static intrandomInt(int range, java.security.SecureRandom secureRandom)The Method randomInt(int) gets an int to the spezified range.static intrandomInt(java.security.SecureRandom secureRandom)The Method randomInt() gets an int between the range 0-9.static intrandomIntBetween(int minVolume, int maxVolume, java.security.SecureRandom secureRandom)Returns a random int between the range from minVolume and maxVolume with theMath.absmethod.static longrandomLong(long range, de.alpharogroup.random.enums.RandomAlgorithm algorithm, java.security.SecureRandom secureRandom)Gets an random long to the given range with the given random algorithm
For example: if you put range to 10 the random int is between 0-9static longrandomLong(long range, java.security.SecureRandom secureRandom)Gets an random long to the given range with the given random algorithm
For example: if you put range to 10 the random int is between 0-9static longrandomLong(java.security.SecureRandom secureRandom)Gets a random longstatic longrandomLongBetween(long start, long end, java.security.SecureRandom secureRandom)Returns a random long between the range from start and end.static shortrandomShort(java.security.SecureRandom secureRandom)Returns a random short
-
-
-
Method Detail
-
randomBoolean
public static boolean randomBoolean(java.security.SecureRandom secureRandom)
Returns a random boolean.- Parameters:
secureRandom- the secure random for boolean generation- Returns:
- The random boolean.
-
randomByte
public static byte randomByte(java.security.SecureRandom secureRandom)
The Method randomByte() selects a random byte.- Parameters:
secureRandom- the secure random for byte generation- Returns:
- The random byte.
-
randomByteArray
public static byte[] randomByteArray(int length, java.security.SecureRandom secureRandom)The Method randomByteArray(int) generates a random byte array.- Parameters:
length- the lengthsecureRandom- the secure random for byte generation- Returns:
- the byte[]
-
randomChar
public static char randomChar(java.security.SecureRandom secureRandom)
Returns a random char.- Parameters:
secureRandom- the secure random for char generation- Returns:
- The generated random char.
-
randomDouble
public static double randomDouble(double range, de.alpharogroup.random.enums.RandomAlgorithm algorithm, java.security.SecureRandom secureRandom)Gets an random double to the given range with the given random algorithm
For example: if you put range to 10 the random float is between 0.0-9.9- Parameters:
range- the rangealgorithm- the random algorithmsecureRandom- the secure random for double generation- Returns:
- an random double not greater then the range
-
randomDouble
public static double randomDouble(double range, java.security.SecureRandom secureRandom)Gets an random double to the given range with the given random algorithm
For example: if you put range to 10 the random float is between 0.0-9.9- Parameters:
range- the rangesecureRandom- the secure random for double generation- Returns:
- an random double not greater then the range
-
randomDouble
public static double randomDouble(java.security.SecureRandom secureRandom)
Gets an random double to the given range with the given random algorithm
For example: if you put range to 10 the random float is between 0.0-9.9- Parameters:
secureRandom- the secure random for double generation- Returns:
- an random double not greater then the range
-
randomDoubleBetween
public static double randomDoubleBetween(double start, double end, java.security.SecureRandom secureRandom)Gets the random double between the range from start and end.- Parameters:
start- the startend- the endsecureRandom- the secure random for double generation- Returns:
- the random double between
-
randomFloat
public static float randomFloat(float range, de.alpharogroup.random.enums.RandomAlgorithm algorithm, java.security.SecureRandom secureRandom)Gets an random float to the given range with the given random algorithm
For example: if you put range to 10 the random float is between 0.0-9.9- Parameters:
range- the rangealgorithm- the random algorithmsecureRandom- the secure random for float generation- Returns:
- an random float not greater then the range
-
randomFloat
public static float randomFloat(float range, java.security.SecureRandom secureRandom)Gets an random float to the given range with the given random algorithm
For example: if you put range to 10 the random float is between 0.0-9.9- Parameters:
range- the rangesecureRandom- the secure random for float generation- Returns:
- an random float not greater then the range
-
randomFloat
public static float randomFloat(java.security.SecureRandom secureRandom)
Generates a random float between the range 0.0-9.9.- Parameters:
secureRandom- the secure random for float generation- Returns:
- the generated random float between the range 0.0-9.9.
-
randomFloatBetween
public static float randomFloatBetween(float start, float end, java.security.SecureRandom secureRandom)Gets the random float between the range from start and end.- Parameters:
start- the startend- the endsecureRandom- the secure random for float generation- Returns:
- the random float between
-
randomInt
public static int randomInt(int range, de.alpharogroup.random.enums.RandomAlgorithm algorithm, java.security.SecureRandom secureRandom)The Method randomInt(int) gets an int to the spezified range. For example: if you put range to 10 the random int is between 0-9.- Parameters:
range- The rangealgorithm- the random algorithmsecureRandom- the secure random for int generation- Returns:
- an int not greater then the range
-
randomInt
public static int randomInt(int range, java.security.SecureRandom secureRandom)The Method randomInt(int) gets an int to the spezified range. For example: if you put range to 10 the random int is between 0-9.- Parameters:
range- The RangesecureRandom- the secure random for int generation- Returns:
- an int not greater then the range.
-
randomInt
public static int randomInt(java.security.SecureRandom secureRandom)
The Method randomInt() gets an int between the range 0-9.- Parameters:
secureRandom- the secure random for int generation- Returns:
- an int between the range 0-9.
-
randomIntBetween
public static int randomIntBetween(int minVolume, int maxVolume, java.security.SecureRandom secureRandom)Returns a random int between the range from minVolume and maxVolume with theMath.absmethod.- Parameters:
minVolume- the min volumemaxVolume- the max volumesecureRandom- the secure random for number generation- Returns:
- A random int between the range from minVolume and maxVolume
-
randomLong
public static long randomLong(long range, de.alpharogroup.random.enums.RandomAlgorithm algorithm, java.security.SecureRandom secureRandom)Gets an random long to the given range with the given random algorithm
For example: if you put range to 10 the random int is between 0-9- Parameters:
range- the rangealgorithm- the random algorithmsecureRandom- the secure random for long generation- Returns:
- an random long not greater then the range
-
randomLong
public static long randomLong(long range, java.security.SecureRandom secureRandom)Gets an random long to the given range with the given random algorithm
For example: if you put range to 10 the random int is between 0-9- Parameters:
range- the rangesecureRandom- the secure random for long generation- Returns:
- an random long not greater then the range
-
randomLong
public static long randomLong(java.security.SecureRandom secureRandom)
Gets a random long- Parameters:
secureRandom- the secure random for long generation- Returns:
- a random long
-
randomLongBetween
public static long randomLongBetween(long start, long end, java.security.SecureRandom secureRandom)Returns a random long between the range from start and end.- Parameters:
start- The long from where the range starts.end- The long from where the range ends.secureRandom- the secure random for long generation- Returns:
- A random long between the range from start and end.
-
randomShort
public static short randomShort(java.security.SecureRandom secureRandom)
Returns a random short- Parameters:
secureRandom- the secure random for short generation- Returns:
- The generated random short
-
-