Lines Matching refs:array
25 * Checks that value is present as at least one of the elements of the array.
26 * @param array the array to check in
28 * @return true if the value is present in the array
30 public static <T> boolean contains(T[] array, T value) {
31 return indexOf(array, value) != -1;
35 * Return first index of {@code value} in {@code array}, or {@code -1} if
38 public static <T> int indexOf(T[] array, T value) {
39 if (array == null) return -1;
40 for (int i = 0; i < array.length; i++) {
41 if (Objects.equals(array[i], value)) return i;