Package com.spun.util

Class ArrayUtils

java.lang.Object
com.spun.util.ArrayUtils

public class ArrayUtils
extends Object
A static class of convenience methods for arrays and collections.
  • Constructor Details

    • ArrayUtils

      public ArrayUtils()
  • Method Details

    • addArray

      public static <T> Collection<T> addArray​(Collection<T> v, T[] array)
    • toString

      public static <T> String toString​(T[] values, Function1<T,​String> formatter)
    • asList

      public static <T> List<T> asList​(T[] values)
    • toString

      public static <T> String toString​(Iterable<T> values, Function1<T,​String> formatter)
    • toReverseVector

      public static Vector toReverseVector​(Vector<Object> vector)
    • toReverseArray

      public static <T> T[] toReverseArray​(T[] array)
    • addToArray

      public static <T> T[] addToArray​(T[] array, T... objects)
    • getSubsection

      public static <T> T[] getSubsection​(T[] array, int startInclusive, int endExclusive)
    • isEmpty

      public static boolean isEmpty​(Object[] array)
    • isEmpty

      public static boolean isEmpty​(Collection<?> collection)
    • getSingleton

      public static <T> T getSingleton​(T[] parts)
    • getFirst

      public static <T> T getFirst​(T[] array)
    • getFirst

      public static <H,​ T extends H> T getFirst​(T[] array, Comparator<H> compartor)
    • getFirst

      public static <H,​ T extends H> T getFirst​(Collection<T> array, Comparator<H> sorter)
    • getLast

      public static <T> T getLast​(T[] array)
    • getLast

      public static <T> T getLast​(T[] array, Comparator<T> sorter)
    • getLast

      public static <T> T getLast​(Collection<T> array, Comparator<T> sorter)
    • combineResults

      public static List<?> combineResults​(Object[] array, String invokeMethod)
    • combineResults

      public static List combineResults​(Object[] array, Method method)
    • combine

      public static <T> T[] combine​(T[] a, T[] b)
    • contains

      public static <T> boolean contains​(T[] values, T value)
    • contains

      public static boolean contains​(int[] values, int value)
    • getLast

      public static <T> T getLast​(List<T> list)
    • getDefault

      public static <K,​ T> T getDefault​(HashMap<K,​T> map, K key, T defaultValue)
    • countValues

      public static <K,​ V> int countValues​(HashMap<K,​V> out, V matching)
    • count

      public static <V> int count​(V matching, Collection<V> values)
    • combine

      public static <T> List<T> combine​(List<T> list1, List<T> list2)
    • asIterable

      public static <T> Iterable<T> asIterable​(Iterator<T> iterator)