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

      @Deprecated public static Vector<Object> toReverseVector(Vector<Object> vector)
      Deprecated.
      for removal in 16.0.0
    • 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(Iterable<?> 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)
    • 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)
    • toArray

      public static <T> T[] toArray(List<T> list)
    • toArray

      public static <T> T[] toArray(List<T> list, Class<T> type)
    • getOrElse

      public static <KEY, VALUES, SPECIFIC_VALUE extends VALUES> SPECIFIC_VALUE getOrElse(Map<KEY,VALUES> fields, KEY key, Function0<SPECIFIC_VALUE> defaultIfNotFound)
    • asList

      public static Collection<Character> asList(char[] toCharArray)
    • of

      public static <T> T[] of(T valueOfEachElement, int sizeOfArray)
    • size

      public static <In> int size(Iterable<In> array)
    • getLast

      public static <In> In getLast(Iterable<In> array)