List of utility methods to do Array Equal
boolean | arraysEqual(Object[] array1, Object[] array2) arrays Equal if (array1.length != array2.length) { return false; for (int i = 0; i < array1.length; ++i) { if (!array1[i].equals(array2[i])) { return false; return true; |
boolean | arraysEqual(String[] arr1, String[] arr2) Match two arrays for equality if (arr1 != null && arr2 == null) { return false; if (arr1 == null && arr2 == null) { return true; if (arr1 == null && arr2 != null) { return false; ... |
boolean | arraysEqual(String[] one, String[] other) arrays Equal if (one == null && other != null) return false; if (one != null && other == null) return false; if (one.length != other.length) return false; for (int i = 0; i < one.length; i++) { if (!equalString(one[i], other[i])) ... |
boolean | arraysEquals(byte[] a, byte[] b) arrays Equals if (a.length != b.length) { return false; return arraysEquals(a, 0, b, 0, a.length); |
boolean | arraysEquals(byte[] a, int ofsA, byte[] b, int ofsB, int len) arrays Equals int end = ofsA + len; while (ofsA < end) { if (b[ofsB++] != a[ofsA++]) { return false; return true; |
boolean | arraysEquals(byte[] arr1, int offset1, byte[] arr2, int offset2) arrays Equals if (arr1 == null || arr2 == null || offset1 < 0 || offset2 < 0 || arr1.length - offset1 != arr2.length - offset2 || arr1.length - offset1 < 0 || arr2.length - offset2 < 0) { return false; boolean result = true; for (int a = offset1; a < arr1.length; a++) { if (arr1[a + offset1] != arr2[a + offset2]) { ... |
boolean | arraysEquals(Object[] mThis, Object[] mThat) arrays Equals if (mThis.length == mThat.length) { for (int i = 0; i < mThis.length; i++) { if (!((mThis[i] == null) && (mThat[i] == null))) { if ((mThis[i] == null) || (mThat[i] == null) || (!mThis[i].equals(mThat[i]))) { return false; return true; } else { return false; |
boolean | blobsAreEqual(byte[] blob1, byte[] blob2) blobs Are Equal return Arrays.equals(blob1, blob2);
|
boolean | bytesAreEqual(byte[] b1, byte[] b2) Compares two byte arrays returning true if they're equal in length and content false if they're not.
return Arrays.equals(b1, b2);
|
boolean | equal(boolean[][] a, boolean[][] b) equal if (a.length != b.length) return false; boolean r = true; for (int i = 0; i < a.length; i++) { if (!Arrays.equals(a[i], b[i])) { r = false; break; return r; |