Class RandomFloatFactory

java.lang.Object
io.github.astrapi69.random.number.RandomFloatFactory

public final class RandomFloatFactory extends Object
Utility class for producing random primitive float types
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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.9
    static 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.9
    static 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.9
    static 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • randomFloat

      public static 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.9
      Parameters:
      range - the range
      algorithm - the random algorithm
      secureRandom - the secure random for float generation
      Returns:
      an random float not greater then the range
    • randomFloat

      public static 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.9
      Parameters:
      range - the range
      secureRandom - the secure random for float generation
      Returns:
      an random float not greater then the range
    • randomFloat

      public static float randomFloat(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.
    • 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

      public 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.9
      Parameters:
      range - the range
      algorithm - 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 start
      end - the end
      Returns:
      the random float between
    • randomFloatBetween

      public static float randomFloatBetween(float start, float end, SecureRandom secureRandom)
      Gets the random float between the range from start and end.
      Parameters:
      start - the start
      end - the end
      secureRandom - the secure random for float generation
      Returns:
      the random float between