@Immutable public final class ArrayHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean[] |
EMPTY_BOOLEAN_ARRAY
Constant empty boolean array
|
static Boolean[] |
EMPTY_BOOLEAN_OBJ_ARRAY
Constant empty boolean array
|
static byte[] |
EMPTY_BYTE_ARRAY
Constant empty byte array
|
static Byte[] |
EMPTY_BYTE_OBJ_ARRAY
Constant empty byte array
|
static char[] |
EMPTY_CHAR_ARRAY
Constant empty char array
|
static Character[] |
EMPTY_CHAR_OBJ_ARRAY
Constant empty char array
|
static Class<?>[] |
EMPTY_CLASS_ARRAY
Constant empty Class<?
|
static double[] |
EMPTY_DOUBLE_ARRAY
Constant empty double array
|
static Double[] |
EMPTY_DOUBLE_OBJ_ARRAY
Constant empty double array
|
static float[] |
EMPTY_FLOAT_ARRAY
Constant empty float array
|
static Float[] |
EMPTY_FLOAT_OBJ_ARRAY
Constant empty float array
|
static int[] |
EMPTY_INT_ARRAY
Constant empty int array
|
static Integer[] |
EMPTY_INT_OBJ_ARRAY
Constant empty int array
|
static long[] |
EMPTY_LONG_ARRAY
Constant empty long array
|
static Long[] |
EMPTY_LONG_OBJ_ARRAY
Constant empty long array
|
static Object[] |
EMPTY_OBJECT_ARRAY
Constant empty Object array
|
static short[] |
EMPTY_SHORT_ARRAY
Constant empty short array
|
static Short[] |
EMPTY_SHORT_OBJ_ARRAY
Constant empty short array
|
static String[] |
EMPTY_STRING_ARRAY
Constant empty String array
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
contains(boolean[] aValues,
boolean aSearchValue)
Check if the passed search value is contained in the passed value array.
|
static boolean |
contains(byte[] aValues,
byte aSearchValue)
Check if the passed search value is contained in the passed value array.
|
static boolean |
contains(char[] aValues,
char aSearchValue)
Check if the passed search value is contained in the passed value array.
|
static boolean |
contains(double[] aValues,
double aSearchValue)
Check if the passed search value is contained in the passed value array.
|
static <ELEMENTTYPE> |
contains(ELEMENTTYPE[] aValues,
ELEMENTTYPE aSearchValue)
Check if the passed search value is contained in the passed value array.
|
static boolean |
contains(float[] aValues,
float aSearchValue)
Check if the passed search value is contained in the passed value array.
|
static boolean |
contains(int[] aValues,
int aSearchValue)
Check if the passed search value is contained in the passed value array.
|
static boolean |
contains(long[] aValues,
long aSearchValue)
Check if the passed search value is contained in the passed value array.
|
static boolean |
contains(short[] aValues,
short aSearchValue)
Check if the passed search value is contained in the passed value array.
|
static <ELEMENTTYPE> |
containsAny(ELEMENTTYPE[] aArray,
Predicate<? super ELEMENTTYPE> aFilter) |
static <T> boolean |
containsAnyNullElement(T[] aArray)
Check if the passed array contains at least one
null element. |
static <T> boolean |
containsOnlyNullElements(T[] aArray)
Check if the passed array contains only
null element. |
static <ELEMENTTYPE> |
findFirst(ELEMENTTYPE[] aArray,
Predicate<? super ELEMENTTYPE> aFilter) |
static <ELEMENTTYPE> |
findFirst(ELEMENTTYPE[] aArray,
Predicate<? super ELEMENTTYPE> aFilter,
ELEMENTTYPE aDefault) |
static <ELEMENTTYPE,RETTYPE> |
findFirstMapped(ELEMENTTYPE[] aArray,
Predicate<? super ELEMENTTYPE> aFilter,
Function<? super ELEMENTTYPE,RETTYPE> aMapper) |
static <ELEMENTTYPE,RETTYPE> |
findFirstMapped(ELEMENTTYPE[] aArray,
Predicate<? super ELEMENTTYPE> aFilter,
Function<? super ELEMENTTYPE,RETTYPE> aMapper,
RETTYPE aDefault) |
static <ELEMENTTYPE> |
forEach(ELEMENTTYPE[] aArray,
Consumer<? super ELEMENTTYPE> aConsumer) |
static <ELEMENTTYPE> |
forEach(ELEMENTTYPE[] aArray,
Predicate<? super ELEMENTTYPE> aFilter,
Consumer<? super ELEMENTTYPE> aConsumer) |
static boolean[] |
getAllExcept(boolean[] aArray,
boolean... aElementsToRemove)
Get an array that contains all elements, except for the passed elements.
|
static byte[] |
getAllExcept(byte[] aArray,
byte... aElementsToRemove)
Get an array that contains all elements, except for the passed elements.
|
static char[] |
getAllExcept(char[] aArray,
char... aElementsToRemove)
Get an array that contains all elements, except for the passed elements.
|
static double[] |
getAllExcept(double[] aArray,
double... aElementsToRemove)
Get an array that contains all elements, except for the passed elements.
|
static <ELEMENTTYPE> |
getAllExcept(ELEMENTTYPE[] aArray,
ELEMENTTYPE... aElementsToRemove)
Get an array that contains all elements, except for the passed elements.
|
static float[] |
getAllExcept(float[] aArray,
float... aElementsToRemove)
Get an array that contains all elements, except for the passed elements.
|
static int[] |
getAllExcept(int[] aArray,
int... aElementsToRemove)
Get an array that contains all elements, except for the passed elements.
|
static long[] |
getAllExcept(long[] aArray,
long... aElementsToRemove)
Get an array that contains all elements, except for the passed elements.
|
static short[] |
getAllExcept(short[] aArray,
short... aElementsToRemove)
Get an array that contains all elements, except for the passed elements.
|
static boolean[] |
getAllExceptFirst(boolean... aArray)
Get an array that contains all elements, except for the first element.
|
static boolean[] |
getAllExceptFirst(boolean[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the first n
elements.
|
static byte[] |
getAllExceptFirst(byte... aArray)
Get an array that contains all elements, except for the first element.
|
static byte[] |
getAllExceptFirst(byte[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the first n
elements.
|
static char[] |
getAllExceptFirst(char... aArray)
Get an array that contains all elements, except for the first element.
|
static char[] |
getAllExceptFirst(char[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the first n
elements.
|
static double[] |
getAllExceptFirst(double... aArray)
Get an array that contains all elements, except for the first element.
|
static double[] |
getAllExceptFirst(double[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the first n
elements.
|
static <ELEMENTTYPE> |
getAllExceptFirst(ELEMENTTYPE... aArray)
Get an array that contains all elements, except for the first element.
|
static <ELEMENTTYPE> |
getAllExceptFirst(ELEMENTTYPE[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the first n
elements.
|
static float[] |
getAllExceptFirst(float... aArray)
Get an array that contains all elements, except for the first element.
|
static float[] |
getAllExceptFirst(float[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the first n
elements.
|
static int[] |
getAllExceptFirst(int... aArray)
Get an array that contains all elements, except for the first element.
|
static int[] |
getAllExceptFirst(int[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the first n
elements.
|
static long[] |
getAllExceptFirst(long... aArray)
Get an array that contains all elements, except for the first element.
|
static long[] |
getAllExceptFirst(long[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the first n
elements.
|
static short[] |
getAllExceptFirst(short... aArray)
Get an array that contains all elements, except for the first element.
|
static short[] |
getAllExceptFirst(short[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the first n
elements.
|
static boolean[] |
getAllExceptLast(boolean... aArray)
Get an array that contains all elements, except for the last element.
|
static boolean[] |
getAllExceptLast(boolean[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the last n
elements.
|
static byte[] |
getAllExceptLast(byte... aArray)
Get an array that contains all elements, except for the last element.
|
static byte[] |
getAllExceptLast(byte[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the last n
elements.
|
static char[] |
getAllExceptLast(char... aArray)
Get an array that contains all elements, except for the last element.
|
static char[] |
getAllExceptLast(char[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the last n
elements.
|
static double[] |
getAllExceptLast(double... aArray)
Get an array that contains all elements, except for the last element.
|
static double[] |
getAllExceptLast(double[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the last n
elements.
|
static <ELEMENTTYPE> |
getAllExceptLast(ELEMENTTYPE... aArray)
Get an array that contains all elements, except for the last element.
|
static <ELEMENTTYPE> |
getAllExceptLast(ELEMENTTYPE[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the last n
elements.
|
static float[] |
getAllExceptLast(float... aArray)
Get an array that contains all elements, except for the last element.
|
static float[] |
getAllExceptLast(float[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the last n
elements.
|
static int[] |
getAllExceptLast(int... aArray)
Get an array that contains all elements, except for the last element.
|
static int[] |
getAllExceptLast(int[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the last n
elements.
|
static long[] |
getAllExceptLast(long... aArray)
Get an array that contains all elements, except for the last element.
|
static long[] |
getAllExceptLast(long[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the last n
elements.
|
static short[] |
getAllExceptLast(short... aArray)
Get an array that contains all elements, except for the last element.
|
static short[] |
getAllExceptLast(short[] aArray,
int nElementsToSkip)
Get an array that contains all elements, except for the last n
elements.
|
static Object[] |
getAsObjectArray(Collection<?> aCollection)
Get the passed collection as an array of Object.
|
static <ELEMENTTYPE> |
getComponentType(ELEMENTTYPE[] aArray)
Get the component type of the array (the type of which the array is made
up)
|
static boolean[] |
getConcatenated(boolean[] aHeadArray,
boolean... aTailArray)
Get a new array that combines the passed two arrays, maintaining the order.
|
static boolean[] |
getConcatenated(boolean[] aHeadArray,
boolean aTail)
Get a new array that combines the passed array and the tail element.
|
static boolean[] |
getConcatenated(boolean aHead,
boolean... aTailArray)
Get a new array that combines the passed head element and the array.
|
static byte[] |
getConcatenated(byte[] aHeadArray,
byte... aTailArray)
Get a new array that combines the passed two arrays, maintaining the order.
|
static byte[] |
getConcatenated(byte[] aHeadArray,
byte aTail)
Get a new array that combines the passed array and the tail element.
|
static byte[] |
getConcatenated(byte aHead,
byte... aTailArray)
Get a new array that combines the passed head element and the array.
|
static char[][] |
getConcatenated(char[][] aHeadArray,
char[]... aTailArray)
Get a new array that combines the passed two arrays, maintaining the order.
|
static char[] |
getConcatenated(char[] aHeadArray,
char... aTailArray)
Get a new array that combines the passed two arrays, maintaining the order.
|
static char[] |
getConcatenated(char[] aHeadArray,
char aTail)
Get a new array that combines the passed array and the tail element.
|
static char[] |
getConcatenated(char aHead,
char... aTailArray)
Get a new array that combines the passed head element and the array.
|
static double[] |
getConcatenated(double[] aHeadArray,
double... aTailArray)
Get a new array that combines the passed two arrays, maintaining the order.
|
static double[] |
getConcatenated(double[] aHeadArray,
double aTail)
Get a new array that combines the passed array and the tail element.
|
static double[] |
getConcatenated(double aHead,
double... aTailArray)
Get a new array that combines the passed head element and the array.
|
static <ELEMENTTYPE> |
getConcatenated(ELEMENTTYPE[] aHeadArray,
ELEMENTTYPE[] aTailArray)
Get a new array that combines the passed two arrays, maintaining the order.
|
static <ELEMENTTYPE> |
getConcatenated(ELEMENTTYPE[] aHeadArray,
ELEMENTTYPE aTail,
Class<ELEMENTTYPE> aClass)
Get a new array that combines the passed array and the tail element.
|
static <ELEMENTTYPE> |
getConcatenated(ELEMENTTYPE aHead,
ELEMENTTYPE[] aTailArray,
Class<ELEMENTTYPE> aClass)
Get a new array that combines the passed head and the array.
|
static float[] |
getConcatenated(float[] aHeadArray,
float... aTailArray)
Get a new array that combines the passed two arrays, maintaining the order.
|
static float[] |
getConcatenated(float[] aHeadArray,
float aTail)
Get a new array that combines the passed array and the tail element.
|
static float[] |
getConcatenated(float aHead,
float... aTailArray)
Get a new array that combines the passed head element and the array.
|
static int[] |
getConcatenated(int[] aHeadArray,
int... aTailArray)
Get a new array that combines the passed two arrays, maintaining the order.
|
static int[] |
getConcatenated(int[] aHeadArray,
int aTail)
Get a new array that combines the passed array and the tail element.
|
static int[] |
getConcatenated(int aHead,
int... aTailArray)
Get a new array that combines the passed head element and the array.
|
static long[] |
getConcatenated(long[] aHeadArray,
long... aTailArray)
Get a new array that combines the passed two arrays, maintaining the order.
|
static long[] |
getConcatenated(long[] aHeadArray,
long aTail)
Get a new array that combines the passed array and the tail element.
|
static long[] |
getConcatenated(long aHead,
long... aTailArray)
Get a new array that combines the passed head element and the array.
|
static short[] |
getConcatenated(short[] aHeadArray,
short... aTailArray)
Get a new array that combines the passed two arrays, maintaining the order.
|
static short[] |
getConcatenated(short[] aHeadArray,
short aTail)
Get a new array that combines the passed array and the tail element.
|
static short[] |
getConcatenated(short aHead,
short... aTailArray)
Get a new array that combines the passed head element and the array.
|
static String[] |
getConcatenated(String[] aHeadArray,
String... aTailArray)
Get a new array that combines the passed two arrays, maintaining the order.
|
static String[] |
getConcatenated(String[] aHeadArray,
String aTail)
Get a new array that combines the passed array and the tail element.
|
static String[] |
getConcatenated(String aHead,
String... aTailArray)
Get a new array that combines the passed head element and the array.
|
static boolean[] |
getCopy(boolean... aArray)
Get a 1:1 copy of the passed array.
|
static boolean[] |
getCopy(boolean[] aArray,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements.
|
static boolean[] |
getCopy(boolean[] aArray,
int nStartIndex,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements starting at the specified index.
|
static byte[] |
getCopy(byte... aArray)
Get a 1:1 copy of the passed array.
|
static byte[] |
getCopy(byte[] aArray,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements.
|
static byte[] |
getCopy(byte[] aArray,
int nStartIndex,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements starting at the specified index.
|
static char[] |
getCopy(char... aArray)
Get a 1:1 copy of the passed array.
|
static char[] |
getCopy(char[] aArray,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements.
|
static char[] |
getCopy(char[] aArray,
int nStartIndex,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements starting at the specified index.
|
static double[] |
getCopy(double... aArray)
Get a 1:1 copy of the passed array.
|
static double[] |
getCopy(double[] aArray,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements.
|
static double[] |
getCopy(double[] aArray,
int nStartIndex,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements starting at the specified index.
|
static <ELEMENTTYPE> |
getCopy(ELEMENTTYPE... aArray)
Get a 1:1 copy of the passed array.
|
static <ELEMENTTYPE> |
getCopy(ELEMENTTYPE[] aArray,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements.
|
static <ELEMENTTYPE> |
getCopy(ELEMENTTYPE[] aArray,
int nStartIndex,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements starting at the specified index.
|
static float[] |
getCopy(float... aArray)
Get a 1:1 copy of the passed array.
|
static float[] |
getCopy(float[] aArray,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements.
|
static float[] |
getCopy(float[] aArray,
int nStartIndex,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements starting at the specified index.
|
static int[] |
getCopy(int... aArray)
Get a 1:1 copy of the passed array.
|
static int[] |
getCopy(int[] aArray,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements.
|
static int[] |
getCopy(int[] aArray,
int nStartIndex,
int nLength)
Get a 1:1 copy of the passed array.
|
static long[] |
getCopy(long... aArray) |
static long[] |
getCopy(long[] aArray,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements.
|
static long[] |
getCopy(long[] aArray,
int nStartIndex,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements starting at the specified index.
|
static short[] |
getCopy(short... aArray)
Get a 1:1 copy of the passed array.
|
static short[] |
getCopy(short[] aArray,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements.
|
static short[] |
getCopy(short[] aArray,
int nStartIndex,
int nLength)
Get a 1:1 copy of the passed array using the passed number of array
elements starting at the specified index.
|
static <ELEMENTTYPE> |
getCount(ELEMENTTYPE[] aArray,
Predicate<? super ELEMENTTYPE> aFilter) |
static boolean |
getFirst(boolean[] aArray,
boolean aDefaultValue)
Get the first element of the array or the passed default if the passed
array is empty.
|
static byte |
getFirst(byte[] aArray,
byte aDefaultValue)
Get the first element of the array or the passed default if the passed
array is empty.
|
static char |
getFirst(char[] aArray,
char aDefaultValue)
Get the first element of the array or the passed default if the passed
array is empty.
|
static double |
getFirst(double[] aArray,
double aDefaultValue)
Get the first element of the array or the passed default if the passed
array is empty.
|
static <ELEMENTTYPE> |
getFirst(ELEMENTTYPE... aArray)
Get the first element of the array or
null if the passed array
is empty. |
static <ELEMENTTYPE> |
getFirst(ELEMENTTYPE[] aArray,
ELEMENTTYPE aDefaultValue)
Get the first element of the array or the passed default if the passed
array is empty.
|
static float |
getFirst(float[] aArray,
float aDefaultValue)
Get the first element of the array or the passed default if the passed
array is empty.
|
static int |
getFirst(int[] aArray,
int aDefaultValue)
Get the first element of the array or the passed default if the passed
array is empty.
|
static long |
getFirst(long[] aArray,
long aDefaultValue)
Get the first element of the array or the passed default if the passed
array is empty.
|
static short |
getFirst(short[] aArray,
short aDefaultValue)
Get the first element of the array or the passed default if the passed
array is empty.
|
static int |
getFirstIndex(boolean[] aValues,
boolean aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getFirstIndex(byte[] aValues,
byte aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getFirstIndex(char[] aValues,
char aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getFirstIndex(double[] aValues,
double aSearchValue)
Get the index of the passed search value in the passed value array.
|
static <ELEMENTTYPE> |
getFirstIndex(ELEMENTTYPE[] aValues,
ELEMENTTYPE aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getFirstIndex(float[] aValues,
float aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getFirstIndex(int[] aValues,
int aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getFirstIndex(long[] aValues,
long aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getFirstIndex(short[] aValues,
short aSearchValue)
Get the index of the passed search value in the passed value array.
|
static boolean |
getLast(boolean[] aArray,
boolean aDefaultValue)
Get the last element of the array or the passed default if the passed array
is empty.
|
static byte |
getLast(byte[] aArray,
byte aDefaultValue)
Get the last element of the array or the passed default if the passed array
is empty.
|
static char |
getLast(char[] aArray,
char aDefaultValue)
Get the last element of the array or the passed default if the passed array
is empty.
|
static double |
getLast(double[] aArray,
double aDefaultValue)
Get the last element of the array or the passed default if the passed array
is empty.
|
static <ELEMENTTYPE> |
getLast(ELEMENTTYPE... aArray)
Get the last element of the array or
null if the passed array
is empty. |
static <ELEMENTTYPE> |
getLast(ELEMENTTYPE[] aArray,
ELEMENTTYPE aDefaultValue)
Get the last element of the array or the passed default if the passed array
is empty.
|
static float |
getLast(float[] aArray,
float aDefaultValue)
Get the last element of the array or the passed default if the passed array
is empty.
|
static int |
getLast(int[] aArray,
int aDefaultValue)
Get the last element of the array or the passed default if the passed array
is empty.
|
static long |
getLast(long[] aArray,
long aDefaultValue)
Get the last element of the array or the passed default if the passed array
is empty.
|
static short |
getLast(short[] aArray,
short aDefaultValue)
Get the last element of the array or the passed default if the passed array
is empty.
|
static int |
getLastIndex(boolean[] aValues,
boolean aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getLastIndex(byte[] aValues,
byte aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getLastIndex(char[] aValues,
char aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getLastIndex(double[] aValues,
double aSearchValue)
Get the index of the passed search value in the passed value array.
|
static <ELEMENTTYPE> |
getLastIndex(ELEMENTTYPE[] aValues,
ELEMENTTYPE aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getLastIndex(float[] aValues,
float aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getLastIndex(int[] aValues,
int aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getLastIndex(long[] aValues,
long aSearchValue)
Get the index of the passed search value in the passed value array.
|
static int |
getLastIndex(short[] aValues,
short aSearchValue)
Get the index of the passed search value in the passed value array.
|
static <ELEMENTTYPE> |
getSafeElement(ELEMENTTYPE[] aItems,
int nIndex) |
static <ELEMENTTYPE> |
getSafeElement(ELEMENTTYPE[] aItems,
int nIndex,
ELEMENTTYPE aDefault) |
static int |
getSize(boolean... aArray) |
static int |
getSize(byte... aArray) |
static int |
getSize(char... aArray) |
static int |
getSize(double... aArray) |
static <ELEMENTTYPE> |
getSize(ELEMENTTYPE... aArray) |
static int |
getSize(float... aArray) |
static int |
getSize(int... aArray) |
static int |
getSize(long... aArray) |
static int |
getSize(short... aArray) |
static boolean |
isArray(Object aObject)
Check if the passed object is an array or not.
|
static boolean |
isArrayEquals(Object aHeadArray,
Object aTailArray)
Recursive equal comparison for arrays.
|
static boolean |
isEmpty(boolean... aArray) |
static boolean |
isEmpty(byte... aArray) |
static boolean |
isEmpty(char... aArray) |
static boolean |
isEmpty(double... aArray) |
static <ELEMENTTYPE> |
isEmpty(ELEMENTTYPE... aArray) |
static boolean |
isEmpty(float... aArray) |
static boolean |
isEmpty(int... aArray) |
static boolean |
isEmpty(long... aArray) |
static boolean |
isEmpty(short... aArray) |
static boolean |
isNotEmpty(boolean... aArray) |
static boolean |
isNotEmpty(byte... aArray) |
static boolean |
isNotEmpty(char... aArray) |
static boolean |
isNotEmpty(double... aArray) |
static <ELEMENTTYPE> |
isNotEmpty(ELEMENTTYPE... aArray) |
static boolean |
isNotEmpty(float... aArray) |
static boolean |
isNotEmpty(int... aArray) |
static boolean |
isNotEmpty(long... aArray) |
static boolean |
isNotEmpty(short... aArray) |
static <ELEMENTTYPE> |
newArray(Class<? extends ELEMENTTYPE> aClass,
int nSize) |
static <ELEMENTTYPE> |
newArray(Collection<? extends ELEMENTTYPE> aCollection,
Class<ELEMENTTYPE> aClass)
Create a new array with the elements in the passed collection..
|
static <ELEMENTTYPE> |
newArray(ELEMENTTYPE... aArray)
Wrapper that allows vararg arguments and returns the array.
|
static <ELEMENTTYPE> |
newArray(int nArraySize,
ELEMENTTYPE aValue,
Class<ELEMENTTYPE> aClass)
Create a new array with a predefined number of elements containing the
passed value.
|
static <SRCTYPE,DSTTYPE> |
newArrayMapped(Collection<? extends SRCTYPE> aCollection,
Function<? super SRCTYPE,? extends DSTTYPE> aMapper,
Class<DSTTYPE> aDstClass) |
static <SRCTYPE,DSTTYPE> |
newArrayMapped(SRCTYPE[] aArray,
Function<? super SRCTYPE,? extends DSTTYPE> aMapper,
Class<DSTTYPE> aDstClass) |
static <ELEMENTTYPE> |
newArraySameType(ELEMENTTYPE[] aArray,
int nSize)
Create a new empty array with the same type as the passed array.
|
static <ELEMENTTYPE> |
newArraySingleElement(ELEMENTTYPE aElement,
Class<ELEMENTTYPE> aClass)
Wrapper that allows a single argument to be treated as an array.
|
static boolean[] |
newBooleanArray(boolean... aArray)
Helper method to easily create an array from constant values.
|
static byte[] |
newByteArray(byte... aArray)
Helper method to easily create an array from constant values.
|
static char[] |
newCharArray(char... aArray)
Helper method to easily create an array from constant values.
|
static double[] |
newDoubleArray(double... aArray)
Helper method to easily create an array from constant values.
|
static float[] |
newFloatArray(float... aArray)
Helper method to easily create an array from constant values.
|
static int[] |
newIntArray(int... aArray)
Helper method to easily create an array from constant values.
|
static long[] |
newLongArray(long... aArray)
Helper method to easily create an array from constant values.
|
static short[] |
newShortArray(short... aArray)
Helper method to easily create an array from constant values.
|
static boolean |
startsWith(byte[] aArray,
byte[] aSearch) |
static boolean |
startsWith(byte[] aArray,
byte[] aSearch,
int nSearchOfs,
int nSearchLen) |
static boolean |
startsWith(byte[] aArray,
int nArrayLen,
byte[] aSearch) |
static boolean |
startsWith(byte[] aArray,
int nArrayLen,
byte[] aSearch,
int nSearchOfs,
int nSearchLen) |
static boolean |
startsWith(byte[] aArray,
int nArrayOfs,
int nArrayLen,
byte[] aSearch,
int nSearchOfs,
int nSearchLen) |
static boolean |
startsWith(char[] aArray,
char[] aSearch) |
static boolean |
startsWith(char[] aArray,
char[] aSearch,
int nSearchOfs,
int nSearchLen) |
static boolean |
startsWith(char[] aArray,
int nArrayLen,
char[] aSearch) |
static boolean |
startsWith(char[] aArray,
int nArrayLen,
char[] aSearch,
int nSearchOfs,
int nSearchLen) |
static boolean |
startsWith(char[] aArray,
int nArrayOfs,
int nArrayLen,
char[] aSearch,
int nSearchOfs,
int nSearchLen) |
public static final boolean[] EMPTY_BOOLEAN_ARRAY
public static final byte[] EMPTY_BYTE_ARRAY
public static final char[] EMPTY_CHAR_ARRAY
public static final double[] EMPTY_DOUBLE_ARRAY
public static final float[] EMPTY_FLOAT_ARRAY
public static final int[] EMPTY_INT_ARRAY
public static final long[] EMPTY_LONG_ARRAY
public static final short[] EMPTY_SHORT_ARRAY
public static final Boolean[] EMPTY_BOOLEAN_OBJ_ARRAY
public static final Byte[] EMPTY_BYTE_OBJ_ARRAY
public static final Character[] EMPTY_CHAR_OBJ_ARRAY
public static final Double[] EMPTY_DOUBLE_OBJ_ARRAY
public static final Float[] EMPTY_FLOAT_OBJ_ARRAY
public static final Integer[] EMPTY_INT_OBJ_ARRAY
public static final Long[] EMPTY_LONG_OBJ_ARRAY
public static final Short[] EMPTY_SHORT_OBJ_ARRAY
public static final Object[] EMPTY_OBJECT_ARRAY
public static final String[] EMPTY_STRING_ARRAY
public static final Class<?>[] EMPTY_CLASS_ARRAY
@Nonnull public static <ELEMENTTYPE> Class<? extends ELEMENTTYPE> getComponentType(@Nonnull ELEMENTTYPE[] aArray)
ELEMENTTYPE - The component type of the arrayaArray - The array to get the type from. May not be null.public static boolean isArray(@Nullable Object aObject)
aObject - The object to be checked. May be null.true if the passed object is not null and
represents an array.@Nonnegative public static int getSize(@Nullable boolean... aArray)
aArray - The array who's size is to be queried. May be null.null - it's length otherwise.@Nonnegative public static int getSize(@Nullable byte... aArray)
aArray - The array who's size is to be queried. May be null.null - it's length otherwise.@Nonnegative public static int getSize(@Nullable char... aArray)
aArray - The array who's size is to be queried. May be null.null - it's length otherwise.@Nonnegative public static int getSize(@Nullable double... aArray)
aArray - The array who's size is to be queried. May be null.null - it's length otherwise.@Nonnegative public static int getSize(@Nullable float... aArray)
aArray - The array who's size is to be queried. May be null.null - it's length otherwise.@Nonnegative public static int getSize(@Nullable int... aArray)
aArray - The array who's size is to be queried. May be null.null - it's length otherwise.@Nonnegative public static int getSize(@Nullable long... aArray)
aArray - The array who's size is to be queried. May be null.null - it's length otherwise.@Nonnegative public static int getSize(@Nullable short... aArray)
aArray - The array who's size is to be queried. May be null.null - it's length otherwise.@Nonnegative @SafeVarargs public static <ELEMENTTYPE> int getSize(@Nullable ELEMENTTYPE... aArray)
ELEMENTTYPE - Array element typeaArray - The array who's size is to be queried. May be null.null - it's length otherwise.public static boolean isEmpty(@Nullable boolean... aArray)
aArray - The array to be queried if it is empty. May be null.true if the passed array is null or
empty.public static boolean isEmpty(@Nullable byte... aArray)
aArray - The array to be queried if it is empty. May be null.true if the passed array is null or
empty.public static boolean isEmpty(@Nullable char... aArray)
aArray - The array to be queried if it is empty. May be null.true if the passed array is null or
empty.public static boolean isEmpty(@Nullable double... aArray)
aArray - The array to be queried if it is empty. May be null.true if the passed array is null or
empty.public static boolean isEmpty(@Nullable float... aArray)
aArray - The array to be queried if it is empty. May be null.true if the passed array is null or
empty.public static boolean isEmpty(@Nullable int... aArray)
aArray - The array to be queried if it is empty. May be null.true if the passed array is null or
empty.public static boolean isEmpty(@Nullable long... aArray)
aArray - The array to be queried if it is empty. May be null.true if the passed array is null or
empty.public static boolean isEmpty(@Nullable short... aArray)
aArray - The array to be queried if it is empty. May be null.true if the passed array is null or
empty.@SafeVarargs public static <ELEMENTTYPE> boolean isEmpty(@Nullable ELEMENTTYPE... aArray)
ELEMENTTYPE - Array element typeaArray - The array to be queried if it is empty. May be null.true if the passed array is null or
empty.public static boolean isNotEmpty(@Nullable boolean... aArray)
aArray - The array to be queried if it is empty. May be null.false if the passed array is null or
empty.public static boolean isNotEmpty(@Nullable byte... aArray)
aArray - The array to be queried if it is empty. May be null.false if the passed array is null or
empty.public static boolean isNotEmpty(@Nullable char... aArray)
aArray - The array to be queried if it is empty. May be null.false if the passed array is null or
empty.public static boolean isNotEmpty(@Nullable double... aArray)
aArray - The array to be queried if it is empty. May be null.false if the passed array is null or
empty.public static boolean isNotEmpty(@Nullable float... aArray)
aArray - The array to be queried if it is empty. May be null.false if the passed array is null or
empty.public static boolean isNotEmpty(@Nullable int... aArray)
aArray - The array to be queried if it is empty. May be null.false if the passed array is null or
empty.public static boolean isNotEmpty(@Nullable long... aArray)
aArray - The array to be queried if it is empty. May be null.false if the passed array is null or
empty.public static boolean isNotEmpty(@Nullable short... aArray)
aArray - The array to be queried if it is empty. May be null.false if the passed array is null or
empty.@SafeVarargs public static <ELEMENTTYPE> boolean isNotEmpty(@Nullable ELEMENTTYPE... aArray)
ELEMENTTYPE - Array element typeaArray - The array to be queried if it is empty. May be null.false if the passed array is null or
empty.public static <ELEMENTTYPE> int getFirstIndex(@Nullable ELEMENTTYPE[] aValues, @Nullable ELEMENTTYPE aSearchValue)
ELEMENTTYPE - Array element typeaValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getFirstIndex(@Nullable boolean[] aValues, boolean aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getFirstIndex(@Nullable byte[] aValues, byte aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getFirstIndex(@Nullable char[] aValues, char aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getFirstIndex(@Nullable double[] aValues, double aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getFirstIndex(@Nullable float[] aValues, float aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getFirstIndex(@Nullable int[] aValues, int aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getFirstIndex(@Nullable long[] aValues, long aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getFirstIndex(@Nullable short[] aValues, short aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static <ELEMENTTYPE> int getLastIndex(@Nullable ELEMENTTYPE[] aValues, @Nullable ELEMENTTYPE aSearchValue)
ELEMENTTYPE - Array element typeaValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getLastIndex(@Nullable boolean[] aValues, boolean aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getLastIndex(@Nullable byte[] aValues, byte aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getLastIndex(@Nullable char[] aValues, char aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getLastIndex(@Nullable double[] aValues, double aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getLastIndex(@Nullable float[] aValues, float aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getLastIndex(@Nullable int[] aValues, int aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getLastIndex(@Nullable long[] aValues, long aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static int getLastIndex(@Nullable short[] aValues, short aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.-1 if the searched value is not contained, a value
≥ 0 otherwise.public static <ELEMENTTYPE> boolean contains(@Nullable ELEMENTTYPE[] aValues, @Nullable ELEMENTTYPE aSearchValue)
ELEMENTTYPE - Array element typeaValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.true if the value array is not empty and the search
value is contained - false otherwise.public static boolean contains(@Nullable boolean[] aValues, boolean aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.true if the value array is not empty and the search
value is contained - false otherwise.public static boolean contains(@Nullable byte[] aValues, byte aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.true if the value array is not empty and the search
value is contained - false otherwise.public static boolean contains(@Nullable char[] aValues, char aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.true if the value array is not empty and the search
value is contained - false otherwise.public static boolean contains(@Nullable double[] aValues, double aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.true if the value array is not empty and the search
value is contained - false otherwise.public static boolean contains(@Nullable float[] aValues, float aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.true if the value array is not empty and the search
value is contained - false otherwise.public static boolean contains(@Nullable int[] aValues, int aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.true if the value array is not empty and the search
value is contained - false otherwise.public static boolean contains(@Nullable long[] aValues, long aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.true if the value array is not empty and the search
value is contained - false otherwise.public static boolean contains(@Nullable short[] aValues, short aSearchValue)
aValues - The value array to be searched. May be null.aSearchValue - The value to be searched. May be null.true if the value array is not empty and the search
value is contained - false otherwise.public static boolean getFirst(@Nullable boolean[] aArray, boolean aDefaultValue)
aArray - The array who's first element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static byte getFirst(@Nullable byte[] aArray, byte aDefaultValue)
aArray - The array who's first element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static char getFirst(@Nullable char[] aArray, char aDefaultValue)
aArray - The array who's first element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static double getFirst(@Nullable double[] aArray, double aDefaultValue)
aArray - The array who's first element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static float getFirst(@Nullable float[] aArray, float aDefaultValue)
aArray - The array who's first element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static int getFirst(@Nullable int[] aArray, int aDefaultValue)
aArray - The array who's first element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static long getFirst(@Nullable long[] aArray, long aDefaultValue)
aArray - The array who's first element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static short getFirst(@Nullable short[] aArray, short aDefaultValue)
aArray - The array who's first element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is empty@Nullable @SafeVarargs public static <ELEMENTTYPE> ELEMENTTYPE getFirst(@Nullable ELEMENTTYPE... aArray)
null if the passed array
is empty.ELEMENTTYPE - Array element typeaArray - The array who's first element is to be retrieved. May be
null or empty.null if the passed array is null or empty
- the first element otherwise (may also be null).@Nullable public static <ELEMENTTYPE> ELEMENTTYPE getFirst(@Nullable ELEMENTTYPE[] aArray, @Nullable ELEMENTTYPE aDefaultValue)
ELEMENTTYPE - Array element typeaArray - The array who's first element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static boolean getLast(@Nullable boolean[] aArray, boolean aDefaultValue)
aArray - The array who's last element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static byte getLast(@Nullable byte[] aArray, byte aDefaultValue)
aArray - The array who's last element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static char getLast(@Nullable char[] aArray, char aDefaultValue)
aArray - The array who's last element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static double getLast(@Nullable double[] aArray, double aDefaultValue)
aArray - The array who's last element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static float getLast(@Nullable float[] aArray, float aDefaultValue)
aArray - The array who's last element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static int getLast(@Nullable int[] aArray, int aDefaultValue)
aArray - The array who's last element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static long getLast(@Nullable long[] aArray, long aDefaultValue)
aArray - The array who's last element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is emptypublic static short getLast(@Nullable short[] aArray, short aDefaultValue)
aArray - The array who's last element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is empty@Nullable @SafeVarargs public static <ELEMENTTYPE> ELEMENTTYPE getLast(@Nullable ELEMENTTYPE... aArray)
null if the passed array
is empty.ELEMENTTYPE - Array element typeaArray - The array who's last element is to be retrieved. May be
null or empty.null if the passed array is null or empty
- the last element otherwise (may also be null).@Nullable public static <ELEMENTTYPE> ELEMENTTYPE getLast(@Nullable ELEMENTTYPE[] aArray, @Nullable ELEMENTTYPE aDefaultValue)
ELEMENTTYPE - Array element typeaArray - The array who's last element is to be retrieved. May be
null or empty.aDefaultValue - The default value to be returned if the array is empty@Nullable @ReturnsMutableCopy public static boolean[] getCopy(@Nullable boolean... aArray)
aArray - The array to be copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static boolean[] getCopy(@Nullable boolean[] aArray, @Nonnegative int nLength)
aArray - The array to be copied.nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, only the available number of elements in the
source array are copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static boolean[] getCopy(@Nullable boolean[] aArray, @Nonnegative int nStartIndex, @Nonnegative int nLength)
aArray - The array to be copied.nStartIndex - The index where the copying should start. Must be >= 0!nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, an exception is thrown.null if the passed array is null - a non-
null copy otherwise.System.arraycopy(Object, int, Object, int, int)@Nullable @ReturnsMutableCopy public static byte[] getCopy(@Nullable byte... aArray)
aArray - The array to be copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static byte[] getCopy(@Nullable byte[] aArray, @Nonnegative int nLength)
aArray - The array to be copied.nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, only the available number of elements in the
source array are copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static byte[] getCopy(@Nullable byte[] aArray, @Nonnegative int nStartIndex, @Nonnegative int nLength)
aArray - The array to be copied.nStartIndex - The index where the copying should start. Must be >= 0!nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, an exception is thrown.null if the passed array is null - a non-
null copy otherwise.System.arraycopy(Object, int, Object, int, int)@Nullable @ReturnsMutableCopy public static char[] getCopy(@Nullable char... aArray)
aArray - The array to be copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static char[] getCopy(@Nullable char[] aArray, @Nonnegative int nLength)
aArray - The array to be copied.nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, only the available number of elements in the
source array are copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static char[] getCopy(@Nullable char[] aArray, @Nonnegative int nStartIndex, @Nonnegative int nLength)
aArray - The array to be copied.nStartIndex - The index where the copying should start. Must be >= 0!nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, an exception is thrown.null if the passed array is null - a non-
null copy otherwise.System.arraycopy(Object, int, Object, int, int)@Nullable @ReturnsMutableCopy public static double[] getCopy(@Nullable double... aArray)
aArray - The array to be copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static double[] getCopy(@Nullable double[] aArray, @Nonnegative int nLength)
aArray - The array to be copied.nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, only the available number of elements in the
source array are copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static double[] getCopy(@Nullable double[] aArray, @Nonnegative int nStartIndex, @Nonnegative int nLength)
aArray - The array to be copied.nStartIndex - The index where the copying should start. Must be >= 0!nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, an exception is thrown.null if the passed array is null - a non-
null copy otherwise.System.arraycopy(Object, int, Object, int, int)@Nullable @ReturnsMutableCopy public static float[] getCopy(@Nullable float... aArray)
aArray - The array to be copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static float[] getCopy(@Nullable float[] aArray, @Nonnegative int nLength)
aArray - The array to be copied.nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, only the available number of elements in the
source array are copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static float[] getCopy(@Nullable float[] aArray, @Nonnegative int nStartIndex, @Nonnegative int nLength)
aArray - The array to be copied.nStartIndex - The index where the copying should start. Must be >= 0!nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, an exception is thrown.null if the passed array is null - a non-
null copy otherwise.System.arraycopy(Object, int, Object, int, int)@Nullable @ReturnsMutableCopy public static int[] getCopy(@Nullable int... aArray)
aArray - The array to be copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static int[] getCopy(@Nullable int[] aArray, @Nonnegative int nLength)
aArray - The array to be copied.nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, only the available number of elements in the
source array are copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static int[] getCopy(@Nullable int[] aArray, @Nonnegative int nStartIndex, @Nonnegative int nLength)
aArray - The array to be copied.nStartIndex - The index where the copying should start. Must be >= 0!nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, an exception is thrown.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static long[] getCopy(@Nullable long... aArray)
@Nullable @ReturnsMutableCopy public static long[] getCopy(@Nullable long[] aArray, @Nonnegative int nLength)
aArray - The array to be copied.nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, only the available number of elements in the
source array are copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static long[] getCopy(@Nullable long[] aArray, @Nonnegative int nStartIndex, @Nonnegative int nLength)
aArray - The array to be copied.nStartIndex - The index where the copying should start. Must be >= 0!nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, an exception is thrown.null if the passed array is null - a non-
null copy otherwise.System.arraycopy(Object, int, Object, int, int)@Nullable @ReturnsMutableCopy public static short[] getCopy(@Nullable short... aArray)
aArray - The array to be copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static short[] getCopy(@Nullable short[] aArray, @Nonnegative int nLength)
aArray - The array to be copied.nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, only the available number of elements in the
source array are copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static short[] getCopy(@Nullable short[] aArray, @Nonnegative int nStartIndex, @Nonnegative int nLength)
aArray - The array to be copied.nStartIndex - The index where the copying should start. Must be >= 0!nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, an exception is thrown.null if the passed array is null - a non-
null copy otherwise.System.arraycopy(Object, int, Object, int, int)@Nullable @ReturnsMutableCopy @SafeVarargs public static <ELEMENTTYPE> ELEMENTTYPE[] getCopy(@Nullable ELEMENTTYPE... aArray)
ELEMENTTYPE - Array element typeaArray - The array to be copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static <ELEMENTTYPE> ELEMENTTYPE[] getCopy(@Nullable ELEMENTTYPE[] aArray, @Nonnegative int nLength)
ELEMENTTYPE - Array element typeaArray - The array to be copied.nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, only the available number of elements in the
source array are copied.null if the passed array is null - a non-
null copy otherwise.@Nullable @ReturnsMutableCopy public static <ELEMENTTYPE> ELEMENTTYPE[] getCopy(@Nullable ELEMENTTYPE[] aArray, @Nonnegative int nStartIndex, @Nonnegative int nLength)
ELEMENTTYPE - Array element typeaArray - The array to be copied.nStartIndex - The index where the copying should start. Must be >= 0!nLength - The number of elements to be copied into the new array. May not be
< 0. If the passed number of elements exceeds the number of
elements in the array, an exception is thrown.null if the passed array is null - a non-
null copy otherwise.System.arraycopy(Object, int, Object, int, int)@Nullable @ReturnsMutableCopy public static <ELEMENTTYPE> ELEMENTTYPE[] getConcatenated(@Nullable ELEMENTTYPE[] aHeadArray, @Nullable ELEMENTTYPE[] aTailArray)
ELEMENTTYPE - Array element typeaHeadArray - The first array. May be null.aTailArray - The second array. May be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> ELEMENTTYPE[] getConcatenated(@Nullable ELEMENTTYPE aHead, @Nullable ELEMENTTYPE[] aTailArray, @Nonnull Class<ELEMENTTYPE> aClass)
ELEMENTTYPE - Array element typeaHead - The first element of the result array. If this element is
null it will be inserted as such into the array!aTailArray - The tail array. May be null.aClass - The element class. Must be present, because in case both elements
are null there would be no way to create a new array.
May not be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> ELEMENTTYPE[] getConcatenated(@Nullable ELEMENTTYPE[] aHeadArray, @Nullable ELEMENTTYPE aTail, @Nonnull Class<ELEMENTTYPE> aClass)
ELEMENTTYPE - Array element typeaHeadArray - The head array. May be null.aTail - The last element of the result array. If this element is
null it will be inserted as such into the array!aClass - The element class. Must be present, because in case both elements
are null there would be no way to create a new array.
May not be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nullable @ReturnsMutableCopy public static boolean[] getConcatenated(@Nullable boolean[] aHeadArray, @Nullable boolean... aTailArray)
aHeadArray - The first array. May be null.aTailArray - The second array. May be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nonnull @ReturnsMutableCopy public static boolean[] getConcatenated(boolean aHead, @Nullable boolean... aTailArray)
aHead - The first element of the result array.aTailArray - The tail array. May be null.null array with all elements in the correct
order.@Nonnull @ReturnsMutableCopy public static boolean[] getConcatenated(@Nullable boolean[] aHeadArray, boolean aTail)
aHeadArray - The head array. May be null.aTail - The last element of the result array.null array with all elements in the correct
order.@Nullable @ReturnsMutableCopy public static byte[] getConcatenated(@Nullable byte[] aHeadArray, @Nullable byte... aTailArray)
aHeadArray - The first array. May be null.aTailArray - The second array. May be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nonnull @ReturnsMutableCopy public static byte[] getConcatenated(byte aHead, @Nullable byte... aTailArray)
aHead - The first element of the result array.aTailArray - The tail array. May be null.null array with all elements in the correct
order.@Nonnull @ReturnsMutableCopy public static byte[] getConcatenated(@Nullable byte[] aHeadArray, byte aTail)
aHeadArray - The head array. May be null.aTail - The last element of the result array.null array with all elements in the correct
order.@Nullable @ReturnsMutableCopy public static char[] getConcatenated(@Nullable char[] aHeadArray, @Nullable char... aTailArray)
aHeadArray - The first array. May be null.aTailArray - The second array. May be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nullable @ReturnsMutableCopy public static char[][] getConcatenated(@Nullable char[][] aHeadArray, @Nullable char[]... aTailArray)
aHeadArray - The first array. May be null.aTailArray - The second array. May be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nonnull @ReturnsMutableCopy public static char[] getConcatenated(char aHead, @Nullable char... aTailArray)
aHead - The first element of the result array.aTailArray - The tail array. May be null.null array with all elements in the correct
order.@Nonnull @ReturnsMutableCopy public static char[] getConcatenated(@Nullable char[] aHeadArray, char aTail)
aHeadArray - The head array. May be null.aTail - The last element of the result array.null array with all elements in the correct
order.@Nullable @ReturnsMutableCopy public static double[] getConcatenated(@Nullable double[] aHeadArray, @Nullable double... aTailArray)
aHeadArray - The first array. May be null.aTailArray - The second array. May be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nonnull @ReturnsMutableCopy public static double[] getConcatenated(double aHead, @Nullable double... aTailArray)
aHead - The first element of the result array.aTailArray - The tail array. May be null.null array with all elements in the correct
order.@Nonnull @ReturnsMutableCopy public static double[] getConcatenated(@Nullable double[] aHeadArray, double aTail)
aHeadArray - The head array. May be null.aTail - The last element of the result array.null array with all elements in the correct
order.@Nullable @ReturnsMutableCopy public static float[] getConcatenated(@Nullable float[] aHeadArray, @Nullable float... aTailArray)
aHeadArray - The first array. May be null.aTailArray - The second array. May be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nonnull @ReturnsMutableCopy public static float[] getConcatenated(float aHead, @Nullable float... aTailArray)
aHead - The first element of the result array.aTailArray - The tail array. May be null.null array with all elements in the correct
order.@Nonnull @ReturnsMutableCopy public static float[] getConcatenated(@Nullable float[] aHeadArray, float aTail)
aHeadArray - The head array. May be null.aTail - The last element of the result array.null array with all elements in the correct
order.@Nullable @ReturnsMutableCopy public static int[] getConcatenated(@Nullable int[] aHeadArray, @Nullable int... aTailArray)
aHeadArray - The first array. May be null.aTailArray - The second array. May be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nonnull @ReturnsMutableCopy public static int[] getConcatenated(int aHead, @Nullable int... aTailArray)
aHead - The first element of the result array.aTailArray - The tail array. May be null.null array with all elements in the correct
order.@Nonnull @ReturnsMutableCopy public static int[] getConcatenated(@Nullable int[] aHeadArray, int aTail)
aHeadArray - The head array. May be null.aTail - The last element of the result array.null array with all elements in the correct
order.@Nullable @ReturnsMutableCopy public static long[] getConcatenated(@Nullable long[] aHeadArray, @Nullable long... aTailArray)
aHeadArray - The first array. May be null.aTailArray - The second array. May be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nonnull @ReturnsMutableCopy public static long[] getConcatenated(long aHead, @Nullable long... aTailArray)
aHead - The first element of the result array.aTailArray - The tail array. May be null.null array with all elements in the correct
order.@Nonnull @ReturnsMutableCopy public static long[] getConcatenated(@Nullable long[] aHeadArray, long aTail)
aHeadArray - The head array. May be null.aTail - The last element of the result array.null array with all elements in the correct
order.@Nullable @ReturnsMutableCopy public static short[] getConcatenated(@Nullable short[] aHeadArray, @Nullable short... aTailArray)
aHeadArray - The first array. May be null.aTailArray - The second array. May be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nonnull @ReturnsMutableCopy public static short[] getConcatenated(short aHead, @Nullable short... aTailArray)
aHead - The first element of the result array.aTailArray - The tail array. May be null.null array with all elements in the correct
order.@Nonnull @ReturnsMutableCopy public static short[] getConcatenated(@Nullable short[] aHeadArray, short aTail)
aHeadArray - The head array. May be null.aTail - The last element of the result array.null array with all elements in the correct
order.@Nonnull @ReturnsMutableCopy public static String[] getConcatenated(@Nullable String[] aHeadArray, @Nullable String... aTailArray)
aHeadArray - The first array. May be null.aTailArray - The second array. May be null.null if both array parameters are null -
a non-null array with all elements in the correct
order otherwise.@Nonnull @ReturnsMutableCopy public static String[] getConcatenated(String aHead, @Nullable String... aTailArray)
aHead - The first element of the result array.aTailArray - The tail array. May be null.null array with all elements in the correct
order.@Nonnull @ReturnsMutableCopy public static String[] getConcatenated(@Nullable String[] aHeadArray, String aTail)
aHeadArray - The head array. May be null.aTail - The last element of the result array.null array with all elements in the correct
order.@Nullable @ReturnsMutableCopy @SafeVarargs public static <ELEMENTTYPE> ELEMENTTYPE[] getAllExceptFirst(@Nullable ELEMENTTYPE... aArray)
ELEMENTTYPE - Array element typeaArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the first element otherwise.@Nullable @ReturnsMutableCopy public static <ELEMENTTYPE> ELEMENTTYPE[] getAllExceptFirst(@Nullable ELEMENTTYPE[] aArray, @Nonnegative int nElementsToSkip)
ELEMENTTYPE - Array element typeaArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the first elements otherwise.@Nullable @ReturnsMutableCopy @SafeVarargs public static <ELEMENTTYPE> ELEMENTTYPE[] getAllExcept(@Nullable ELEMENTTYPE[] aArray, @Nullable ELEMENTTYPE... aElementsToRemove)
ELEMENTTYPE - Array element typeaArray - The source array. May be null.aElementsToRemove - The elements to skip.null if the passed array is null. The
original array, if no elements need to be skipped. A non-
null copy of the array without the passed elements
otherwise.@Nullable @ReturnsMutableCopy public static boolean[] getAllExcept(@Nullable boolean[] aArray, @Nullable boolean... aElementsToRemove)
aArray - The source array. May be null.aElementsToRemove - The elements to skip.null if the passed array is null. The
original array, if no elements need to be skipped. A non-
null copy of the array without the passed elements
otherwise.@Nullable @ReturnsMutableCopy public static byte[] getAllExcept(@Nullable byte[] aArray, @Nullable byte... aElementsToRemove)
aArray - The source array. May be null.aElementsToRemove - The elements to skip.null if the passed array is null. The
original array, if no elements need to be skipped. A non-
null copy of the array without the passed elements
otherwise.@Nullable @ReturnsMutableCopy public static char[] getAllExcept(@Nullable char[] aArray, @Nullable char... aElementsToRemove)
aArray - The source array. May be null.aElementsToRemove - The elements to skip.null if the passed array is null. The
original array, if no elements need to be skipped. A non-
null copy of the array without the passed elements
otherwise.@Nullable @ReturnsMutableCopy public static double[] getAllExcept(@Nullable double[] aArray, @Nullable double... aElementsToRemove)
aArray - The source array. May be null.aElementsToRemove - The elements to skip.null if the passed array is null. The
original array, if no elements need to be skipped. A non-
null copy of the array without the passed elements
otherwise.@Nullable @ReturnsMutableCopy public static float[] getAllExcept(@Nullable float[] aArray, @Nullable float... aElementsToRemove)
aArray - The source array. May be null.aElementsToRemove - The elements to skip.null if the passed array is null. The
original array, if no elements need to be skipped. A non-
null copy of the array without the passed elements
otherwise.@Nullable @ReturnsMutableCopy public static int[] getAllExcept(@Nullable int[] aArray, @Nullable int... aElementsToRemove)
aArray - The source array. May be null.aElementsToRemove - The elements to skip.null if the passed array is null. The
original array, if no elements need to be skipped. A non-
null copy of the array without the passed elements
otherwise.@Nullable @ReturnsMutableCopy public static long[] getAllExcept(@Nullable long[] aArray, @Nullable long... aElementsToRemove)
aArray - The source array. May be null.aElementsToRemove - The elements to skip.null if the passed array is null. The
original array, if no elements need to be skipped. A non-
null copy of the array without the passed elements
otherwise.@Nullable @ReturnsMutableCopy public static short[] getAllExcept(@Nullable short[] aArray, @Nullable short... aElementsToRemove)
aArray - The source array. May be null.aElementsToRemove - The elements to skip.null if the passed array is null. The
original array, if no elements need to be skipped. A non-
null copy of the array without the passed elements
otherwise.@Nullable @ReturnsMutableCopy public static boolean[] getAllExceptFirst(@Nullable boolean... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the first element otherwise.@Nullable @ReturnsMutableCopy public static boolean[] getAllExceptFirst(@Nullable boolean[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the first elements otherwise.@Nullable @ReturnsMutableCopy public static byte[] getAllExceptFirst(@Nullable byte... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the first element otherwise.@Nullable @ReturnsMutableCopy public static byte[] getAllExceptFirst(@Nullable byte[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the first elements otherwise.@Nullable @ReturnsMutableCopy public static char[] getAllExceptFirst(@Nullable char... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the first element otherwise.@Nullable @ReturnsMutableCopy public static char[] getAllExceptFirst(@Nullable char[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the first elements otherwise.@Nullable @ReturnsMutableCopy public static double[] getAllExceptFirst(@Nullable double... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the first element otherwise.@Nullable @ReturnsMutableCopy public static double[] getAllExceptFirst(@Nullable double[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the first elements otherwise.@Nullable @ReturnsMutableCopy public static float[] getAllExceptFirst(@Nullable float... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the first element otherwise.@Nullable @ReturnsMutableCopy public static float[] getAllExceptFirst(@Nullable float[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the first elements otherwise.@Nullable @ReturnsMutableCopy public static int[] getAllExceptFirst(@Nullable int... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the first element otherwise.@Nullable @ReturnsMutableCopy public static int[] getAllExceptFirst(@Nullable int[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the first elements otherwise.@Nullable @ReturnsMutableCopy public static long[] getAllExceptFirst(@Nullable long... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the first element otherwise.@Nullable @ReturnsMutableCopy public static long[] getAllExceptFirst(@Nullable long[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the first elements otherwise.@Nullable @ReturnsMutableCopy public static short[] getAllExceptFirst(@Nullable short... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the first element otherwise.@Nullable @ReturnsMutableCopy public static short[] getAllExceptFirst(@Nullable short[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the first elements otherwise.@Nullable @ReturnsMutableCopy @SafeVarargs public static <ELEMENTTYPE> ELEMENTTYPE[] getAllExceptLast(@Nullable ELEMENTTYPE... aArray)
ELEMENTTYPE - Array element typeaArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the last element otherwise.@Nullable @ReturnsMutableCopy public static <ELEMENTTYPE> ELEMENTTYPE[] getAllExceptLast(@Nullable ELEMENTTYPE[] aArray, @Nonnegative int nElementsToSkip)
ELEMENTTYPE - Type of elementaArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the last elements otherwise.@Nullable @ReturnsMutableCopy public static boolean[] getAllExceptLast(@Nullable boolean... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the last element otherwise.@Nullable @ReturnsMutableCopy public static boolean[] getAllExceptLast(@Nullable boolean[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the last elements otherwise.@Nullable @ReturnsMutableCopy public static byte[] getAllExceptLast(@Nullable byte... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the last element otherwise.@Nullable @ReturnsMutableCopy public static byte[] getAllExceptLast(@Nullable byte[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the last elements otherwise.@Nullable @ReturnsMutableCopy public static char[] getAllExceptLast(@Nullable char... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the last element otherwise.@Nullable @ReturnsMutableCopy public static char[] getAllExceptLast(@Nullable char[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the last elements otherwise.@Nullable @ReturnsMutableCopy public static double[] getAllExceptLast(@Nullable double... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the last element otherwise.@Nullable @ReturnsMutableCopy public static double[] getAllExceptLast(@Nullable double[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the last elements otherwise.@Nullable @ReturnsMutableCopy public static float[] getAllExceptLast(@Nullable float... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the last element otherwise.@Nullable @ReturnsMutableCopy public static float[] getAllExceptLast(@Nullable float[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the last elements otherwise.@Nullable @ReturnsMutableCopy public static int[] getAllExceptLast(@Nullable int... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the last element otherwise.@Nullable @ReturnsMutableCopy public static int[] getAllExceptLast(@Nullable int[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the last elements otherwise.@Nullable @ReturnsMutableCopy public static long[] getAllExceptLast(@Nullable long... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the last element otherwise.@Nullable @ReturnsMutableCopy public static long[] getAllExceptLast(@Nullable long[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the last elements otherwise.@Nullable @ReturnsMutableCopy public static short[] getAllExceptLast(@Nullable short... aArray)
aArray - The source array. May be null.null if the passed array is null or has
less than one element. A non-null copy of the array
without the last element otherwise.@Nullable @ReturnsMutableCopy public static short[] getAllExceptLast(@Nullable short[] aArray, @Nonnegative int nElementsToSkip)
aArray - The source array. May be null.nElementsToSkip - The number of elements to skip. Must be >= 0!null if the passed array is null or has
≤ elements than elements to be skipped. A non-null
copy of the array without the last elements otherwise.@Nullable @ReturnsMutableObject(value="use getCopy otherwise") public static boolean[] newBooleanArray(@Nullable boolean... aArray)
aArray - The list of values for the array. May be null.null if the passed array was
null.@Nullable @ReturnsMutableObject(value="use getCopy otherwise") public static byte[] newByteArray(@Nullable byte... aArray)
aArray - The list of values for the array. May be null.null if the passed array was
null.@Nullable @ReturnsMutableObject(value="use getCopy otherwise") public static char[] newCharArray(@Nullable char... aArray)
aArray - The list of values for the array. May be null.null if the passed array was
null.@Nullable @ReturnsMutableObject(value="use getCopy otherwise") public static double[] newDoubleArray(@Nullable double... aArray)
aArray - The list of values for the array. May be null.null if the passed array was
null.@Nullable @ReturnsMutableObject(value="use getCopy otherwise") public static float[] newFloatArray(@Nullable float... aArray)
aArray - The list of values for the array. May be null.null if the passed array was
null.@Nullable @ReturnsMutableObject(value="use getCopy otherwise") public static int[] newIntArray(@Nullable int... aArray)
aArray - The list of values for the array. May be null.null if the passed array was
null.@Nullable @ReturnsMutableObject(value="use getCopy otherwise") public static long[] newLongArray(@Nullable long... aArray)
aArray - The list of values for the array. May be null.null if the passed array was
null.@Nullable @ReturnsMutableObject(value="use getCopy otherwise") public static short[] newShortArray(@Nullable short... aArray)
aArray - The list of values for the array. May be null.null if the passed array was
null.@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> ELEMENTTYPE[] newArray(@Nonnull Class<? extends ELEMENTTYPE> aClass, @Nonnegative int nSize)
@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> ELEMENTTYPE[] newArraySameType(@Nonnull ELEMENTTYPE[] aArray, @Nonnegative int nSize)
ELEMENTTYPE - Type of elementaArray - Source array. May not be null.nSize - Destination size. Must be ≥ 0.null.@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> ELEMENTTYPE[] newArray(@Nullable Collection<? extends ELEMENTTYPE> aCollection, @Nonnull Class<ELEMENTTYPE> aClass)
ELEMENTTYPE - Type of elementaCollection - The collection to be converted to an array. May be null
.aClass - The class of the elements inside the collection. May not be
null.null if the passed collection is empty, a non-
null array with all elements of the collection
otherwise.@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> ELEMENTTYPE[] newArraySingleElement(@Nullable ELEMENTTYPE aElement, @Nonnull Class<ELEMENTTYPE> aClass)
ELEMENTTYPE - Type of elementaElement - The element to be converted to an array. May be null.aClass - The class of the element. May not be null. Must be
present because in case the passed element is null
there is no way to determine the array component type!null.@Nonnull @ReturnsMutableObject(value="use getCopy otherwise") @SafeVarargs public static <ELEMENTTYPE> ELEMENTTYPE[] newArray(@Nonnull ELEMENTTYPE... aArray)
ELEMENTTYPE - Type of elementaArray - The vararg array@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> ELEMENTTYPE[] newArray(@Nonnegative int nArraySize, @Nonnull ELEMENTTYPE aValue, @Nonnull Class<ELEMENTTYPE> aClass)
ELEMENTTYPE - The type of the array to be created.nArraySize - The size of the array to be created.aValue - The value to be set into each array element. May be
null.aClass - The value class. May not be null. Must be present in
case the passed value is null.@Nonnull @ReturnsMutableCopy public static <SRCTYPE,DSTTYPE> DSTTYPE[] newArrayMapped(@Nonnull Collection<? extends SRCTYPE> aCollection, @Nonnull Function<? super SRCTYPE,? extends DSTTYPE> aMapper, @Nonnull Class<DSTTYPE> aDstClass)
@Nonnull @ReturnsMutableCopy public static <SRCTYPE,DSTTYPE> DSTTYPE[] newArrayMapped(@Nullable SRCTYPE[] aArray, @Nonnull Function<? super SRCTYPE,? extends DSTTYPE> aMapper, @Nonnull Class<DSTTYPE> aDstClass)
@Nullable @ReturnsMutableCopy public static Object[] getAsObjectArray(@Nullable Collection<?> aCollection)
null or empty, an empty array is returned.aCollection - The collection to be converted. May be null.null.@Nullable public static <ELEMENTTYPE> ELEMENTTYPE getSafeElement(@Nullable ELEMENTTYPE[] aItems, int nIndex)
@Nullable public static <ELEMENTTYPE> ELEMENTTYPE getSafeElement(@Nullable ELEMENTTYPE[] aItems, int nIndex, @Nullable ELEMENTTYPE aDefault)
public static boolean isArrayEquals(@Nullable Object aHeadArray, @Nullable Object aTailArray)
aHeadArray - First array. May be null.aTailArray - Second array. May be null.true only if the arrays and all contained elements are
recursively equal.public static <T> boolean containsAnyNullElement(@Nullable T[] aArray)
null element.T - element typeaArray - The array to check. May be null.true only if the passed array is neither
null nor empty and if at least one null
element is contained.public static <T> boolean containsOnlyNullElements(@Nullable T[] aArray)
null element.T - element typeaArray - The array to check. May be null.true only if the passed array is neither
null nor empty and if at least one null
element is contained.@Nullable public static <ELEMENTTYPE> ELEMENTTYPE findFirst(@Nullable ELEMENTTYPE[] aArray, @Nullable Predicate<? super ELEMENTTYPE> aFilter)
@Nullable public static <ELEMENTTYPE> ELEMENTTYPE findFirst(@Nullable ELEMENTTYPE[] aArray, @Nullable Predicate<? super ELEMENTTYPE> aFilter, @Nullable ELEMENTTYPE aDefault)
@Nullable public static <ELEMENTTYPE,RETTYPE> RETTYPE findFirstMapped(@Nullable ELEMENTTYPE[] aArray, @Nullable Predicate<? super ELEMENTTYPE> aFilter, @Nonnull Function<? super ELEMENTTYPE,RETTYPE> aMapper)
@Nullable public static <ELEMENTTYPE,RETTYPE> RETTYPE findFirstMapped(@Nullable ELEMENTTYPE[] aArray, @Nullable Predicate<? super ELEMENTTYPE> aFilter, @Nonnull Function<? super ELEMENTTYPE,RETTYPE> aMapper, @Nullable RETTYPE aDefault)
@Nonnegative public static <ELEMENTTYPE> int getCount(@Nullable ELEMENTTYPE[] aArray, @Nullable Predicate<? super ELEMENTTYPE> aFilter)
public static <ELEMENTTYPE> boolean containsAny(@Nullable ELEMENTTYPE[] aArray, @Nullable Predicate<? super ELEMENTTYPE> aFilter)
public static <ELEMENTTYPE> void forEach(@Nullable ELEMENTTYPE[] aArray, @Nonnull Consumer<? super ELEMENTTYPE> aConsumer)
public static <ELEMENTTYPE> void forEach(@Nullable ELEMENTTYPE[] aArray, @Nullable Predicate<? super ELEMENTTYPE> aFilter, @Nonnull Consumer<? super ELEMENTTYPE> aConsumer)
public static boolean startsWith(@Nonnull byte[] aArray, @Nonnegative int nArrayLen, @Nullable byte[] aSearch)
public static boolean startsWith(@Nonnull byte[] aArray, @Nullable byte[] aSearch, @Nonnegative int nSearchOfs, @Nonnegative int nSearchLen)
public static boolean startsWith(@Nonnull byte[] aArray, @Nonnegative int nArrayLen, @Nullable byte[] aSearch, @Nonnegative int nSearchOfs, @Nonnegative int nSearchLen)
public static boolean startsWith(@Nonnull byte[] aArray, @Nonnegative int nArrayOfs, @Nonnegative int nArrayLen, @Nullable byte[] aSearch, @Nonnegative int nSearchOfs, @Nonnegative int nSearchLen)
public static boolean startsWith(@Nonnull char[] aArray, @Nonnegative int nArrayLen, @Nullable char[] aSearch)
public static boolean startsWith(@Nonnull char[] aArray, @Nullable char[] aSearch, @Nonnegative int nSearchOfs, @Nonnegative int nSearchLen)
public static boolean startsWith(@Nonnull char[] aArray, @Nonnegative int nArrayLen, @Nullable char[] aSearch, @Nonnegative int nSearchOfs, @Nonnegative int nSearchLen)
public static boolean startsWith(@Nonnull char[] aArray, @Nonnegative int nArrayOfs, @Nonnegative int nArrayLen, @Nullable char[] aSearch, @Nonnegative int nSearchOfs, @Nonnegative int nSearchLen)
Copyright © 2014–2022 Philip Helger. All rights reserved.