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