List of utility methods to do Array Index Of
int | indexOf(byte[] array, byte[] target, int start) origin: https://code.google.com/p/guava-libraries/source/browse/guava/src/com/google/common/primitives/Bytes.java Returns the start position of the first occurrence of the specified target within array , or -1 if there is no such occurrence. checkNotNull(array, "array"); checkNotNull(target, "target"); if (target.length == 0) { return 0; outer: for (int i = start; i < array.length - target.length + 1; i++) { for (int j = 0; j < target.length; j++) { if (array[i + j] != target[j]) { ... |
int | indexOf(byte[] target, byte[] key) index Of return indexOf(target, key, 0);
|
int | indexOf(char toBeFound, char[] array) index Of for (int i = 0; i < array.length; i++) { if (toBeFound == array[i]) return i; return -1; |
int | indexOf(final String[] p_elements, final String p_key) index Of if (p_elements == null) { return -1; return Arrays.asList(p_elements).indexOf(p_key); |
int | indexOf(final T[] array, final T value) index Of final int alen = array.length; for (int i = 0; i < alen; i++) { if (value.equals(array[i])) { return i; return INDEX_NOT_FOUND; |
int | indexOf(int[] arr, int e) index Of for (int i = 0; i < arr.length; i++) { if (arr[i] == e) { return i; return -1; |
int | indexOf(int[] arr, int val) index Of if (arr == null) return -1; for (int i = 0; i < arr.length; i++) if (arr[i] == val) return i; return -1; |
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) Finds the index of the given object in the array. This method returns #INDEX_NOT_FOUND ( -1 ) for a null input array. return indexOf(array, objectToFind, 0);
|
int | indexOf(Object[] elements, Object value) Returns the index of the first occurrence of the specified element in this array, or -1 if this list does not contain the element. int index = 0; for (Object element : elements) { if (equals(element, value)) { return index; ++index; return -1; ... |