Package arc.util
Class Structs
java.lang.Object
arc.util.Structs
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T[]
add
(T[] array, T item) static <T> T[]
arr
(T... array) static <T,
U extends Comparable<? super U>>
Comparator<T>static <T,
U> Comparator<T> comparing
(Func<? super T, ? extends U> keyExtractor, Comparator<? super U> keyComparator) static <T> Comparator<T>
comparingBool
(Boolf<? super T> keyExtractor) static <T> Comparator<T>
comparingFloat
(Floatf<? super T> keyExtractor) static <T> Comparator<T>
comparingInt
(Intf<? super T> keyExtractor) static <T> Comparator<T>
comparingLong
(Longf<? super T> keyExtractor) static <T> Comparator<T>
comps
(Comparator<T> first, Comparator<T> second) Equivalent to Comparator#thenComparsing, but more compatible.static <T> boolean
static <T> boolean
contains
(T[] array, T value) Uses identity comparisons.static <T> int
static <T> void
static boolean
static <T> T[]
static <T> void
Remove all values that match this predicate.static <T> void
Remove all values that match this predicate.static <T> T
static <T> T
findMin
(Iterable<T> arr, Boolf<T> allow, Comparator<T> comp) static <T> T
findMin
(Iterable<T> arr, Comparator<T> comp) static <T> T
static <T> T
findMin
(T[] arr, Comparator<T> comp) static <T> void
static boolean
inBounds
(int x, int y, boolean[][] array) static boolean
inBounds
(int x, int y, float[][] array) static boolean
inBounds
(int x, int y, int[][] array) static boolean
inBounds
(int x, int y, int width, int height) static boolean
inBounds
(int x, int y, int z, int[][][] array) static boolean
inBounds
(int x, int y, int z, int size, int padding) static <T> boolean
inBounds
(int x, int y, int z, T[][][] array) static <T> boolean
inBounds
(int x, int y, T[][] array) static <T> int
static <T> int
static <T> int
indexOf
(T[] array, T value) static <T> T
static <T> T
random
(T... array) static <T> T[]
remove
(T[] array, int index) static <T> T[]
remove
(T[] array, T value) static <T> void
swap
(T[] array, int a, int b)
-
Constructor Details
-
Structs
public Structs()
-
-
Method Details
-
eq
-
arr
public static <T> T[] arr(T... array) -
filter
Remove all values that match this predicate. -
filter
Remove all values that match this predicate. -
random
public static <T> T random(T... array) -
random
-
count
-
contains
public static <T> boolean contains(T[] array, T value) Uses identity comparisons. -
contains
-
find
-
indexOf
-
indexOf
public static <T> int indexOf(T[] array, T value) -
indexOf
-
remove
public static <T> T[] remove(T[] array, T value) -
remove
public static <T> T[] remove(T[] array, int index) -
add
public static <T> T[] add(T[] array, T item) -
swap
public static <T> void swap(T[] array, int a, int b) -
filter
-
comps
Equivalent to Comparator#thenComparsing, but more compatible. -
comparing
public static <T,U> Comparator<T> comparing(Func<? super T, ? extends U> keyExtractor, Comparator<? super U> keyComparator) -
comparing
public static <T,U extends Comparable<? super U>> Comparator<T> comparing(Func<? super T, ? extends U> keyExtractor) -
comparingFloat
-
comparingInt
-
comparingLong
-
comparingBool
-
each
-
forEach
-
findMin
-
findMin
-
findMin
-
findMin
-
inBounds
public static <T> boolean inBounds(int x, int y, T[][] array) -
inBounds
public static boolean inBounds(int x, int y, int[][] array) -
inBounds
public static boolean inBounds(int x, int y, float[][] array) -
inBounds
public static boolean inBounds(int x, int y, boolean[][] array) -
inBounds
public static <T> boolean inBounds(int x, int y, int z, T[][][] array) -
inBounds
public static boolean inBounds(int x, int y, int z, int[][][] array) -
inBounds
public static boolean inBounds(int x, int y, int z, int size, int padding) -
inBounds
public static boolean inBounds(int x, int y, int width, int height)
-