-
- All Implemented Interfaces:
public final class ArrayUtils
-
-
Method Summary
Modifier and Type Method Description static <T> Array<T>add(Array<T> array, Class<T> componentType, T element)Adds a specific element to a specific array with a specific component type if the array does not contain the element yet. static <T> Array<T>insert(T element, Array<T> array, Class<T> componentType)Inserts the given element into an open (null) slot in the array if there is one, otherwise creates a new array and adds all existing elements and the given element static <T> Array<T>concat(Array<T> first, Array<T> second)Concatenates two arrays. static <T> booleanisNullOrEmpty(Array<T> array)Tests whether the array passed in as an argument is null or empty. -
-
Method Detail
-
add
static <T> Array<T> add(Array<T> array, Class<T> componentType, T element)
Adds a specific element to a specific array with a specific component type if the array does not contain the element yet.
- Parameters:
array- the array to add element tocomponentType- the component type of arrayelement- the element to add to array
-
insert
static <T> Array<T> insert(T element, Array<T> array, Class<T> componentType)
Inserts the given element into an open (null) slot in the array if there is one, otherwise creates a new array and adds all existing elements and the given element
- Parameters:
element- the element to addarray- the array to add to, if possiblecomponentType- the class type of the array (used if a new one needs to be allocated)
-
isNullOrEmpty
static <T> boolean isNullOrEmpty(Array<T> array)
Tests whether the array passed in as an argument is null or empty.
-
-
-
-