/** * Check if the specified object equals to this object. The check is based on the index and * ignore-case properties of the two objects. * * @param obj Object: the object to compare * @return boolean: true if the argument equals this object */ public boolean equals(Object obj) { if (obj instanceof ArrayComparator) { ArrayComparator oac = (ArrayComparator) obj; int[] i1 = oac.getIndices(); int[] i2 = this.getIndices(); if (i1.length == i2.length) { for (int i = 0; i < i1.length; i++) { if (i1[i] != i2[i]) { return false; } } if (oac.isIgnoreCase() == this.isIgnoreCase()) { return true; } } } return false; }