Class CollectionUtils
java.lang.Object
io.github.syst3ms.skriptparser.util.CollectionUtils
Utility functions for Collection objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T[]arrayOf(T... values) static <T> booleancontains(T[] array, T... contained) static <T> TgetRandom(T[] array) static <T> intordinalConditionalIndexOf(T[] array, int n, Predicate<T> condition) Find the index of an item, where a given predicate applies, from a given class in an array, skipping over all these items as long as the amount of items skipped is smaller than a given amount.static <T> T[]reverseArray(T[] array)
-
Constructor Details
-
CollectionUtils
public CollectionUtils()
-
-
Method Details
-
arrayOf
-
getRandom
public static <T> T getRandom(T[] array) -
reverseArray
public static <T> T[] reverseArray(T[] array) -
contains
-
ordinalConditionalIndexOf
Find the index of an item, where a given predicate applies, from a given class in an array, skipping over all these items as long as the amount of items skipped is smaller than a given amount.- Parameters:
array- the arrayn- the ordinal you want to get the index fromcondition- the condition- Returns:
- the index,
-1if no index was found
-