List of utility methods to do Array Last Index Of
int | lastIndexOf(double[] array, double 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(double[] array, double valueToFind, int startIndex, double tolerance) Finds the last index of the given value in the array starting at the given index. if (ArrayUtils.isEmpty(array)) { return INDEX_NOT_FOUND; if (startIndex < 0) { return INDEX_NOT_FOUND; } else if (startIndex >= array.length) { startIndex = array.length - 1; double min = valueToFind - tolerance; double max = valueToFind + tolerance; for (int i = startIndex; i >= 0; i--) { if (array[i] >= min && array[i] <= max) { return i; return INDEX_NOT_FOUND; |
int | lastIndexOf(float[] array, float 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(float[] array, float 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(int[] array, int 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(int[] array, int 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(long[] array, long 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(long[] array, long 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(short[] array, short 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(short[] array, short 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; |