Package arc.util

Class Structs

java.lang.Object
arc.util.Structs

public class Structs extends Object
  • Constructor Details

    • Structs

      public Structs()
  • Method Details

    • eq

      public static boolean eq(Object a, Object b)
    • arr

      public static <T> T[] arr(T... array)
    • filter

      public static <T> void filter(Iterable<T> iterable, Boolf<T> removal)
      Remove all values that match this predicate.
    • filter

      public static <T> void filter(Iterator<T> it, Boolf<T> removal)
      Remove all values that match this predicate.
    • random

      public static <T> T random(T... array)
    • random

      public static <T> T random(Rand rand, T... array)
    • count

      public static <T> int count(T[] array, Boolf<T> value)
    • contains

      public static <T> boolean contains(T[] array, T value)
      Uses identity comparisons.
    • contains

      public static <T> boolean contains(T[] array, Boolf<T> value)
    • find

      public static <T> T find(T[] array, Boolf<T> value)
    • indexOf

      public static <T> int indexOf(Iterable<T> array, Boolf<T> value)
    • indexOf

      public static <T> int indexOf(T[] array, T value)
    • indexOf

      public static <T> int indexOf(T[] array, Boolf<T> value)
    • 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

      public static <T> T[] filter(Class<T> type, T[] array, Boolf<T> value)
    • comps

      public static <T> Comparator<T> comps(Comparator<T> first, Comparator<T> second)
      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

      public static <T> Comparator<T> comparingFloat(Floatf<? super T> keyExtractor)
    • comparingInt

      public static <T> Comparator<T> comparingInt(Intf<? super T> keyExtractor)
    • comparingLong

      public static <T> Comparator<T> comparingLong(Longf<? super T> keyExtractor)
    • comparingBool

      public static <T> Comparator<T> comparingBool(Boolf<? super T> keyExtractor)
    • each

      public static <T> void each(Cons<T> cons, T... objects)
    • forEach

      public static <T> void forEach(Iterable<T> i, Cons<T> cons)
    • findMin

      public static <T> T findMin(T[] arr, Comparator<T> comp)
    • findMin

      public static <T> T findMin(T[] arr, Floatf<T> proc)
    • findMin

      public static <T> T findMin(Iterable<T> arr, Comparator<T> comp)
    • findMin

      public static <T> T findMin(Iterable<T> arr, Boolf<T> allow, Comparator<T> comp)
    • 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)