java.lang.Object
ushiosan.jvm_utilities.lang.random.Rand
Class containing utilities for pseudorandom actions
-
Method Summary
Modifier and TypeMethodDescriptionReturns a pseudorandom object to use in the methods of this same classgetRandom(long seed) Returns a pseudorandom object to use in the methods of this same classstatic int[]getRandomRange(int start, int end, long limit) Returns an array of pseudorandom numbers within a specified rangestatic int[]getRandomRange(int start, int end, long limit, boolean inclusive) Returns an array of pseudorandom numbers within a specified rangestatic long[]getRandomRange(long start, long end, long limit) Returns an array of pseudorandom numbers within a specified rangestatic long[]getRandomRange(long start, long end, long limit, boolean inclusive) Returns an array of pseudorandom numbers within a specified rangegetRandomString(char... ignore) Returns a pseudo random text string, depending on the selected settinggetRandomString(int size, char... ignore) Returns a pseudo random text string, depending on the selected settinggetRandomString(int size, @NotNull TextType type, char... ignore) Returns a pseudo random text string, depending on the selected setting
-
Method Details
-
getRandom
Returns a pseudorandom object to use in the methods of this same class- Parameters:
seed- seed responsible for generating the pseudorandom values- Returns:
- the
Randominstance
-
getRandom
Returns a pseudorandom object to use in the methods of this same class- Returns:
- the
Randominstance
-
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 havetype- the type of configuration usedignore- all the characters you want to ignore within the result- Returns:
- a pseudo random text string
- See Also:
-
getRandomString
Returns a pseudo random text string, depending on the selected setting- Parameters:
size- size of characters that the string will haveignore- all the characters you want to ignore within the result- Returns:
- a pseudo random text string
- See Also:
-
getRandomString
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 arrayinclusive- iftruethe end of the range is included within the allowed valuesfalseif 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 arrayinclusive- iftruethe end of the range is included within the allowed valuesfalseif 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:
-