Operations on arrays, primitive arrays (like int[]) and primitive wrapper arrays (like Integer[]).
This class tries to handle null input gracefully. An exception will not be thrown for a null array
input. However, an Object array that contains a null element may throw an exception. Each method documents
its behaviour.
Package private, might move to an internal package if this needs to be public.
#ThreadSafe#
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | INDEX_NOT_FOUND
The index value when an element is not found in a list or array: |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static boolean | |
| pack-priv static <T> int | Returns: the index of the object within the array,INDEX_NOT_FOUND (-1) if not found or
null array inputthe array to search through for the object, may be array, final Object nullthe object to find, may be objectToFind)nullFinds the index of the given object in the array. |
| pack-priv static int | Returns: the index of the object within the array starting at the index,INDEX_NOT_FOUND (-1) if
not found or null array inputthe array to search through for the object, may be array, final Object nullthe object to find, may be objectToFind, int nullthe index to start searching at startIndex)Finds the index of the given object in the array starting at the given index. |
| INDEX_NOT_FOUND | back to summary |
|---|---|
| pack-priv static final int INDEX_NOT_FOUND The index value when an element is not found in a list or array: | |
| ArrayUtils | back to summary |
|---|---|
| pack-priv ArrayUtils() | |
| contains | back to summary |
|---|---|
| pack-priv static boolean contains(final Object[] array, final Object objectToFind) Checks if the object is in the given array.
The method returns | |
| indexOf | back to summary |
|---|---|
| pack-priv static <T> int indexOf(final T[] array, final Object objectToFind) Finds the index of the given object in the array.
This method returns
| |
| indexOf | back to summary |
|---|---|
| pack-priv static int indexOf(final Object[] array, final Object objectToFind, int startIndex) Finds the index of the given object in the array starting at the given index.
This method returns
A negative startIndex is treated as zero. A startIndex larger than the array length will return
| |