/** * Compares the specified object with this domain element list for equality. If the two objects are instances of the {@link DefaultDomain1D} * class, then the test check for the equality of the single elements. */ @SuppressWarnings("unchecked") @Override public boolean equals(final Object object) { if (this == object) return true; if (!(object instanceof DefaultDomain1D)) return false; final DefaultDomain1D that = (DefaultDomain1D) object; if (getEquivalenceClass() != that.getEquivalenceClass()) return false; if (!this.getName().equals(that.getName())) return false; if (!this.getApproximateDomainRange().equals(that.getApproximateDomainRange())) return false; if (Arrays.equals(this.elements, that.elements)) { assert Arrays.equals(this.minimums, that.minimums); return true; } return false; }
/** * Compares the specified object with this domain element list for equality. If the two objects are instances of the {@link DefaultDomain1D} * class, then the test check for the equality of the single elements. */ @SuppressWarnings("unchecked") @Override public boolean equals(final Object object) { if (this == object) return true; if (!(object instanceof DefaultDomain1D)) return false; final DefaultDomain1D that = (DefaultDomain1D) object; if (getEquivalenceClass() != that.getEquivalenceClass()) return false; if (!this.getName().equals(that.getName())) return false; if (!this.getApproximateDomainRange().equals(that.getApproximateDomainRange())) return false; if (Arrays.equals(this.elements, that.elements)) { assert Arrays.equals(this.minimums, that.minimums); return true; } return false; }
@Override public int hashCode() { if (hashCode < 0) { int result = PiecewiseUtilities.deepHashCode(elements); result = PiecewiseUtilities.deepHashCode(minimums); result = PiecewiseUtilities.hash(getName(), result); hashCode = PiecewiseUtilities.hash(getApproximateDomainRange(), hashCode); } return hashCode; } }
@Override public int hashCode() { if (hashCode < 0) { int result = PiecewiseUtilities.deepHashCode(elements); result = PiecewiseUtilities.deepHashCode(minimums); result = PiecewiseUtilities.hash(getName(), result); hashCode = PiecewiseUtilities.hash(getApproximateDomainRange(), hashCode); } return hashCode; } }