java.lang.Object
ushiosan.jvm_utilities.lang.random.Rand

public final class Rand extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a pseudorandom object to use in the methods of this same class
    getRandom(long seed)
    Returns a pseudorandom object to use in the methods of this same class
    static int[]
    getRandomRange(int start, int end, long limit)
    Returns an array of pseudorandom numbers within a specified range
    static int[]
    getRandomRange(int start, int end, long limit, boolean inclusive)
    Returns an array of pseudorandom numbers within a specified range
    static long[]
    getRandomRange(long start, long end, long limit)
    Returns an array of pseudorandom numbers within a specified range
    static long[]
    getRandomRange(long start, long end, long limit, boolean inclusive)
    Returns an array of pseudorandom numbers within a specified range
    getRandomString(char... ignore)
    Returns a pseudo random text string, depending on the selected setting
    getRandomString(int size, char... ignore)
    Returns a pseudo random text string, depending on the selected setting
    getRandomString(int size, @NotNull TextType type, char... ignore)
    Returns a pseudo random text string, depending on the selected setting

    Methods inherited from class java.lang.Object

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

    • getRandom

      @NotNull public static @NotNull Random getRandom(long seed)
      Returns a pseudorandom object to use in the methods of this same class
      Parameters:
      seed - seed responsible for generating the pseudorandom values
      Returns:
      the Random instance
    • getRandom

      @NotNull public static @NotNull Random getRandom()
      Returns a pseudorandom object to use in the methods of this same class
      Returns:
      the Random instance
    • getRandomString

      @NotNull public static @NotNull String getRandomString(int size, @NotNull @NotNull TextType type, char... ignore)
      Returns a pseudo random text string, depending on the selected setting
      Parameters:
      size - size of characters that the string will have
      type - the type of configuration used
      ignore - all the characters you want to ignore within the result
      Returns:
      a pseudo random text string
      See Also:
    • getRandomString

      @NotNull public static @NotNull String getRandomString(int size, char... ignore)
      Returns a pseudo random text string, depending on the selected setting
      Parameters:
      size - size of characters that the string will have
      ignore - all the characters you want to ignore within the result
      Returns:
      a pseudo random text string
      See Also:
    • getRandomString

      @NotNull public static @NotNull String getRandomString(char... ignore)
      Returns a pseudo random text string, depending on the selected setting
      Parameters:
      ignore - all the characters you want to ignore within the result
      Returns:
      a pseudo random text string
      See Also:
    • getRandomRange

      public static int[] getRandomRange(int start, int end, long limit, boolean inclusive)
      Returns an array of pseudorandom numbers within a specified range
      Parameters:
      start - the start of the range (inclusive)
      end - the end of the range (no inclusive)
      limit - total elements in array
      inclusive - if true the end of the range is included within the allowed values false if the end of the range is excluded from the allowed values
      Returns:
      an array of pseudorandom numbers
    • getRandomRange

      public static int[] getRandomRange(int start, int end, long limit)
      Returns an array of pseudorandom numbers within a specified range
      Parameters:
      start - the start of the range (inclusive)
      end - the end of the range (no inclusive)
      limit - total elements in array
      Returns:
      an array of pseudorandom numbers
      See Also:
    • getRandomRange

      public static long[] getRandomRange(long start, long end, long limit, boolean inclusive)
      Returns an array of pseudorandom numbers within a specified range
      Parameters:
      start - the start of the range (inclusive)
      end - the end of the range (no inclusive)
      limit - total elements in array
      inclusive - if true the end of the range is included within the allowed values false if the end of the range is excluded from the allowed values
      Returns:
      an array of pseudorandom numbers
    • getRandomRange

      public static long[] getRandomRange(long start, long end, long limit)
      Returns an array of pseudorandom numbers within a specified range
      Parameters:
      start - the start of the range (inclusive)
      end - the end of the range (no inclusive)
      limit - total elements in array
      Returns:
      an array of pseudorandom numbers
      See Also: