List of utility methods to do Array Equal
boolean | allEqual(int[] arr) Returns true if all values in the array are equal. for (int i = 0; i < arr.length; i++) { if (arr[0] != arr[i]) return false; return true; |
boolean | allEqual(int[] values) Checks if elements in the given array are all equal. if (values.length == 0) { return true; int value = values[0]; for (int i = 1; i < values.length; i++) { if (values[i] != value) { return false; return true; |
boolean | allEquals(double[][] sims) all Equals double prev = 0; for (int i = 0; i < sims.length; i++) { for (int j = 0; j < sims[0].length; j++) { if (!(i == 0 && j == 0)) if (sims[i][j] != prev) return false; prev = sims[i][j]; return true; |
boolean | allEquals(final String value, final String... strings) Return true if all strings are the same. for (final String s : strings) { if (s == null && value != null || s != null && value != null && !s.equals(value)) { return false; return true; |
boolean | allEquals(int needle, byte... bytes) all Equals int i = 0; while (i < bytes.length && bytes[i] == needle) i++; return i == bytes.length; |
boolean | allEquals(int y, int y2, int y3) all Equals if ((y == y2) && (y2 == y3)) { return true; return false; |
boolean | areEqualArrays(Object[] a1, Object[] a2) are Equal Arrays return Arrays.equals(a1, a2);
|
boolean | arrayEq(byte[] a, byte[] b) array Eq if (a.length != b.length) { return false; for (int i = 0; i < a.length; i++) { if (a[i] != b[i]) return false; return true; ... |
boolean | arrayEqual(char[] a, char[] b, int aStart, int bStart, int length) array Equal for (int i = 0; i < length; i++) { if (a[aStart + i] != b[bStart + i]) { return false; return true; |
boolean | arrayEquals(byte[] data, byte[] expected) array Equals if (data.length != expected.length) return false; for (int i = 0; i < data.length; i++) { if (data[i] != expected[i]) return false; return true; |