java.lang.Object
io.github.astrapi69.random.number.RandomIntFactory
Utility class for producing random primitive int types
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
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
randomInt
(int range, RandomAlgorithm algorithm) The Method randomInt(int) gets an int to the spezified range.static int
randomInt
(int range, RandomAlgorithm algorithm, SecureRandom secureRandom) The Method randomInt(int) gets an int to the spezified range.static int
randomInt
(int range, SecureRandom secureRandom) The Method randomInt(int) gets an int to the spezified range.static int
randomInt
(SecureRandom secureRandom) The Method randomInt() gets an int between the range 0-9.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 int
randomIntBetween
(int start, int end, boolean includeMin, boolean includeMax, SecureRandom secureRandom) Returns a random int between the range from start and end.static int
randomIntBetween
(int minVolume, int maxVolume, SecureRandom secureRandom) Returns a random int between the range from minVolume and maxVolume with theMath.abs
method.
-
Method Details
-
randomInt
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 algorithm- Returns:
- an int not greater then the range
-
randomInt
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
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
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.
-
randomInt
public static int randomInt()The Method randomInt() gets an int between the range 0-9.- Returns:
- an int between the range 0-9.
-
randomInt
public static int randomInt(int range) 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 Range.- Returns:
- an int not greater then the range.
-
randomIntBetween
Returns a random int between the range from minVolume and maxVolume with theMath.abs
method.- 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
-
randomIntBetween
public static int randomIntBetween(int start, int end, boolean includeMin, boolean includeMax, SecureRandom secureRandom) Returns a random int between the range from start and end.- Parameters:
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 includedsecureRandom
- the secure random for generation- Returns:
- A random int between the range from start and end.
-
randomIntBetween
public static int randomIntBetween(int start, int end) Returns a random int between the range from start and end.- Parameters:
start
- The int from where the range starts.end
- The int from where the range ends.- Returns:
- A random int between the range from start and end.
-
randomIntBetween
public static int randomIntBetween(int start, int end, boolean includeMin, boolean includeMax) Returns a random int between the range from start and end.- Parameters:
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 included- Returns:
- A random int between the range from start and end.
-