List of utility methods to do Array Index Of
int | indexOf(Object[] array, Object obj) index Of for (int i = 0; i < array.length; ++i) { if (obj == array[i]) { return i; throw new NoSuchElementException("" + obj); |
int | indexOf(Object[] array, Object objectToFind) Finds the index of the given object in the array. This method returns #INDEX_NOT_FOUND ( return indexOf(array, objectToFind, 0);
|
int | indexOf(Object[] array, Object objectToFind, int startIndex) Finds the index of the given object in the array starting at the given index. This method returns #INDEX_NOT_FOUND ( A negative startIndex is treated as zero. if (array == null) { return INDEX_NOT_FOUND; if (startIndex < 0) { startIndex = 0; if (objectToFind == null) { for (int i = startIndex; i < array.length; i++) { ... |
int | indexOf(T e, T[] array) index Of for (int i = 0; i != array.length; ++i) { if (array[i].equals(e)) return i; return -1; |
int | indexOf(boolean[] array, boolean valueToFind) Finds the index of the given value in the array. This method returns #INDEX_NOT_FOUND ( return indexOf(array, valueToFind, 0);
|
int | indexOf(boolean[] array, boolean valueToFind, int startIndex) Finds the index of the given value in the array starting at the given index. This method returns #INDEX_NOT_FOUND ( A negative startIndex is treated as zero. if (ArrayUtils.isEmpty(array)) { return INDEX_NOT_FOUND; if (startIndex < 0) { startIndex = 0; for (int i = startIndex; i < array.length; i++) { if (valueToFind == array[i]) { ... |
int | indexOf(byte[] array, byte valueToFind) Finds the index of the given value in the array. This method returns #INDEX_NOT_FOUND ( return indexOf(array, valueToFind, 0);
|
int | indexOf(byte[] array, byte valueToFind, int startIndex) Finds the index of the given value in the array starting at the given index. This method returns #INDEX_NOT_FOUND ( A negative startIndex is treated as zero. if (array == null) { return INDEX_NOT_FOUND; if (startIndex < 0) { startIndex = 0; for (int i = startIndex; i < array.length; i++) { if (valueToFind == array[i]) { ... |
int | indexOf(char[] array, char valueToFind) Finds the index of the given value in the array. This method returns #INDEX_NOT_FOUND ( return indexOf(array, valueToFind, 0);
|
int | indexOf(char[] array, char valueToFind, int startIndex) Finds the index of the given value in the array starting at the given index. This method returns #INDEX_NOT_FOUND ( A negative startIndex is treated as zero. if (array == null) { return INDEX_NOT_FOUND; if (startIndex < 0) { startIndex = 0; for (int i = startIndex; i < array.length; i++) { if (valueToFind == array[i]) { ... |