List of utility methods to do Array Last Index Of
int | lastIndexOf(Object[] array, Object objectToFind) Finds the last index of the given object within the array. This method returns #INDEX_NOT_FOUND ( return lastIndexOf(array, objectToFind, Integer.MAX_VALUE);
|
int | lastIndexOf(Object[] array, Object objectToFind, int startIndex) Finds the last index of the given object in the array starting at the given index. This method returns #INDEX_NOT_FOUND ( A negative startIndex will return #INDEX_NOT_FOUND ( if (array == null) { return INDEX_NOT_FOUND; if (startIndex < 0) { return INDEX_NOT_FOUND; } else if (startIndex >= array.length) { startIndex = array.length - 1; if (objectToFind == null) { for (int i = startIndex; i >= 0; i--) { if (array[i] == null) { return i; } else if (array.getClass().getComponentType() .isInstance(objectToFind)) { for (int i = startIndex; i >= 0; i--) { if (objectToFind.equals(array[i])) { return i; return INDEX_NOT_FOUND; |
int | lastIndexOf(boolean[] array, boolean valueToFind) Finds the last index of the given value within the array. This method returns #INDEX_NOT_FOUND ( return lastIndexOf(array, valueToFind, Integer.MAX_VALUE);
|
int | lastIndexOf(boolean[] array, boolean valueToFind, int startIndex) Finds the last index of the given value in the array starting at the given index. This method returns #INDEX_NOT_FOUND ( A negative startIndex will return #INDEX_NOT_FOUND ( if (ArrayUtils.isEmpty(array)) { return INDEX_NOT_FOUND; if (startIndex < 0) { return INDEX_NOT_FOUND; } else if (startIndex >= array.length) { startIndex = array.length - 1; for (int i = startIndex; i >= 0; i--) { if (valueToFind == array[i]) { return i; return INDEX_NOT_FOUND; |
int | lastIndexOf(byte[] array, byte valueToFind) Finds the last index of the given value within the array. This method returns #INDEX_NOT_FOUND ( return lastIndexOf(array, valueToFind, Integer.MAX_VALUE);
|
int | lastIndexOf(byte[] array, byte valueToFind, int startIndex) Finds the last index of the given value in the array starting at the given index. This method returns #INDEX_NOT_FOUND ( A negative startIndex will return #INDEX_NOT_FOUND ( if (array == null) { return INDEX_NOT_FOUND; if (startIndex < 0) { return INDEX_NOT_FOUND; } else if (startIndex >= array.length) { startIndex = array.length - 1; for (int i = startIndex; i >= 0; i--) { if (valueToFind == array[i]) { return i; return INDEX_NOT_FOUND; |
int | lastIndexOf(char[] array, char valueToFind) Finds the last index of the given value within the array. This method returns #INDEX_NOT_FOUND ( return lastIndexOf(array, valueToFind, Integer.MAX_VALUE);
|
int | lastIndexOf(char[] array, char valueToFind, int startIndex) Finds the last index of the given value in the array starting at the given index. This method returns #INDEX_NOT_FOUND ( A negative startIndex will return #INDEX_NOT_FOUND ( if (array == null) { return INDEX_NOT_FOUND; if (startIndex < 0) { return INDEX_NOT_FOUND; } else if (startIndex >= array.length) { startIndex = array.length - 1; for (int i = startIndex; i >= 0; i--) { if (valueToFind == array[i]) { return i; return INDEX_NOT_FOUND; |
int | lastIndexOf(double[] array, double valueToFind) Finds the last index of the given value within the array. This method returns #INDEX_NOT_FOUND ( return lastIndexOf(array, valueToFind, Integer.MAX_VALUE);
|
int | lastIndexOf(double[] array, double valueToFind, double tolerance) Finds the last index of the given value within a given tolerance in the array. return lastIndexOf(array, valueToFind, Integer.MAX_VALUE, tolerance);
|