Package com.spun.util
Class ArrayUtils
java.lang.Object
com.spun.util.ArrayUtils
A static class of convenience methods for arrays and collections.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Collection<T>addArray(Collection<T> v, T[] array) static <T> T[]addToArray(T[] array, T... objects) static <T> Iterable<T>asIterable(Iterator<T> iterator) static Collection<Character>asList(char[] toCharArray) static <T> List<T>asList(T[] values) static <T> List<T>static <T> T[]combine(T[] a, T[] b) static <T> T[]combine(T a, T... b) static ListcombineResults(Object[] array, Method method) static List<?>combineResults(Object[] array, String invokeMethod) static booleancontains(int[] values, int value) static <T> booleancontains(T[] values, T value) static <V> intcount(V matching, Collection<V> values) static <K,V> int countValues(HashMap<K, V> out, V matching) static <K,T> T getDefault(HashMap<K, T> map, K key, T defaultValue) static <H,T extends H>
TgetFirst(Collection<T> array, Comparator<H> sorter) static <T> TgetFirst(T[] array) static <H,T extends H>
TgetFirst(T[] array, Comparator<H> compartor) static <In> Instatic <T> TgetLast(Collection<T> array, Comparator<T> sorter) static <T> Tstatic <T> TgetLast(T[] array) static <T> TgetLast(T[] array, Comparator<T> sorter) static <KEY,VALUES, SPECIFIC_VALUE extends VALUES>
SPECIFIC_VALUEstatic <T> TgetSingleton(T[] parts) static <T> T[]getSubsection(T[] array, int startInclusive, int endExclusive) static booleanstatic booleanstatic <T> T[]of(T valueOfEachElement, int sizeOfArray) static <In> intstatic <T> T[]static <T> T[]static <T> T[]toReverseArray(T[] array) toReverseVector(Vector<Object> vector) Deprecated.for removal in 16.0.0static <T> Stringstatic <T> String
-
Constructor Details
-
ArrayUtils
public ArrayUtils()
-
-
Method Details
-
addArray
-
toString
-
asList
-
toString
-
toReverseVector
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
-
isEmpty
-
getSingleton
public static <T> T getSingleton(T[] parts) -
getFirst
public static <T> T getFirst(T[] array) -
getFirst
-
getFirst
-
getLast
public static <T> T getLast(T[] array) -
getLast
-
getLast
-
combineResults
-
combineResults
-
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
-
getDefault
-
countValues
-
count
-
combine
-
asIterable
-
toArray
-
toArray
-
getOrElse
-
asList
-
of
public static <T> T[] of(T valueOfEachElement, int sizeOfArray) -
size
-
getLast
-