java.lang.Object
io.github.astrapi69.random.number.RandomFloatFactory
Utility class for producing random primitive float types
-
Method Summary
Modifier and TypeMethodDescriptionstatic float
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
(float range, RandomAlgorithm algorithm) 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 float
randomFloat
(float range, RandomAlgorithm algorithm, 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 float
randomFloat
(float range, 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 float
randomFloat
(int afterComma, int beforeComma) The Method getRandomFloat(int,int) gets an random float.static float
randomFloat
(SecureRandom secureRandom) Generates a random float between the range 0.0-9.9.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, SecureRandom secureRandom) Gets the random float between the range from start and end.
-
Method Details
-
randomFloat
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
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
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.
-
randomFloat
public static float randomFloat()Generates a random float between the range 0.0-9.9.- Returns:
- the generated random float between the range 0.0-9.9.
-
randomFloat
public static float randomFloat(float range) The Method randomFloat(float) gets an float to the spezified range. For example: if you put range to 10.0 the random int is between 0.0-9.9.- Parameters:
range
- the range- Returns:
- the float
-
randomFloat
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 algorithm- Returns:
- an random float not greater then the range
-
randomFloat
public static float randomFloat(int afterComma, int beforeComma) The Method getRandomFloat(int,int) gets an random float.- Parameters:
afterComma
- How many decimal places after the comma.beforeComma
- How many decimal places before the comma.- Returns:
- The produced float.
-
randomFloatBetween
public static float randomFloatBetween(float start, float end) Gets the random float between the range from start and end.- Parameters:
start
- the startend
- the end- Returns:
- the random float between
-
randomFloatBetween
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
-