Class ArrayHelpers
java.lang.Object
top.girlkisser.lazuli.api.collections.ArrayHelpers
Provides a handful of helpers for arrays.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontains(int[] array, int entry) Check if an array contains a given value.static <T> booleancontains(T[] array, T entry) Check if an array contains a given value.static int[]rangeOf(int max) Creates an array using the provided range where the starting value is 0.static int[]rangeOf(int min, int max) Creates an array using the provided range.static int[]rangeOf(int min, int max, int step) Creates an array using the provided range.
-
Method Details
-
rangeOf
public static int[] rangeOf(int min, int max, int step) Creates an array using the provided range.- Parameters:
min- The initial value (inclusive).max- The ending value (exclusive).step- The step between values.- Returns:
- An array containing the range of integers.
-
rangeOf
public static int[] rangeOf(int min, int max) Creates an array using the provided range.- Parameters:
min- The initial value (inclusive).max- The ending value (exclusive).- Returns:
- An array containing the range of integers.
-
rangeOf
public static int[] rangeOf(int max) Creates an array using the provided range where the starting value is 0.- Parameters:
max- The ending value (exclusive).- Returns:
- An array containing the range of integers.
-
contains
public static <T> boolean contains(T[] array, T entry) Check if an array contains a given value.- Type Parameters:
T- The array's type.- Parameters:
array- The array to check.entry- The entry to check for.- Returns:
- Whether the array contains the given entry.
-
contains
public static boolean contains(int[] array, int entry) Check if an array contains a given value.- Parameters:
array- The array to check.entry- The entry to check for.- Returns:
- Whether the array contains the given entry.
-