List of utility methods to do Array Index Of
int | arrayIndex(T[] arr, T item) array Index if (arr == null) { return -1; for (int i = 0; i < arr.length; i++) { if (arr[i].equals(item)) { return i; return -1; |
void | arrayIndexCheck(char[] text, int startPos, int endPos) array Index Check if (text == null || startPos < 0 || startPos > endPos) { throw new ArrayIndexOutOfBoundsException("text.length: " + (text == null ? 0 : text.length) + ", startPos: " + startPos + ", endPos: " + endPos); |
String | arrayIndexClean(String indx) array Index Clean if (indx.length() >= 2 && indx.charAt(0) == '\"' && indx.charAt(indx.length() - 1) == '\"') return indx.substring(1, indx.length() - 1); else return "#" + indx + "#"; |
int | arrayIndexFor(final String raw) DOCUMENT ME! if (raw.isEmpty()) { return -1; if (raw.charAt(0) == '0') { return (raw.length() == 1) ? 0 : -1; try { return Integer.parseInt(raw); ... |
int | ArrayIndexOf(byte[] data, byte[] dest) Array Index Of return ArrayIndexOf(data, dest, 0);
|
int | arrayIndexOf(int needle, int[] haystack) Sequentially search through an array, return the index of first needle element in haystack or -1, if not found. for (int i = 0; i < haystack.length; i++) { if (haystack[i] == needle) { return i; return -1; |
int | arrayIndexOf(int value, int[] arr) array Index Of for (int i = 0; i < arr.length; i++) { if (arr[i] == value) return i; return -1; |
int | arrayIndexOf(Object[] array, Object element) array Index Of for (int i = 0; i < array.length; i++) { if (element.equals(array[i])) { return i; return -1; |
long | arrayIndexOffset(int index, long baseOffset, long indexScale) array Index Offset if (index < 0) throw new IndexOutOfBoundsException("index " + index); return baseOffset + (long) index * indexScale; |
int | indexOf(byte[] array, byte[] target, int fromIndex) Returns the index (start position) of the first occurrence of the specified target within array starting at fromIndex , or -1 if there is no such occurrence. if (array == null || target == null) { return -1; if (fromIndex < 0 || (fromIndex > (array.length - target.length))) { return -1; if (target.length == 0) { return fromIndex; ... |