Class RandomIntFactory

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

public final class RandomIntFactory extends Object
Utility class for producing random primitive int types
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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 the Math.abs method.

    Methods inherited from class java.lang.Object

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

    • randomInt

      public static int randomInt(int range, RandomAlgorithm algorithm)
      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
      algorithm - the random algorithm
      Returns:
      an int not greater then the range
    • randomInt

      public static int randomInt(int range, RandomAlgorithm algorithm, 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 range
      algorithm - the random algorithm
      secureRandom - the secure random for int generation
      Returns:
      an int not greater then the range
    • randomInt

      public static int randomInt(int range, 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 Range
      secureRandom - the secure random for int generation
      Returns:
      an int not greater then the range.
    • randomInt

      public static int randomInt(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.
    • 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

      public static int randomIntBetween(int minVolume, int maxVolume, SecureRandom secureRandom)
      Returns a random int between the range from minVolume and maxVolume with the Math.abs method.
      Parameters:
      minVolume - the min volume
      maxVolume - the max volume
      secureRandom - 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 included
      includeMax - if true than max value is included
      secureRandom - 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 included
      includeMax - if true than max value is included
      Returns:
      A random int between the range from start and end.