/** * Implementation of {@link Object#equals(Object)} for {@link DomainElement1D}s. * * <p> * Two {@link DefaultDomainElement1D}s are considered to be equal if they have the same inputr range and the same name. * * @param obj the reference object with which to compare. * @return <code>true</code> if this object is the same as the obj argument; <code>false</code> otherwise. * @see Object#equals(Object) */ public boolean equals(final Object obj) { if (obj == this) { return true; } if (obj instanceof DefaultDomainElement1D) return false; final DefaultDomainElement1D that = (DefaultDomainElement1D) obj; if (getEquivalenceClass() != that.getEquivalenceClass()) return false; if (!PiecewiseUtilities.equals(inputMinimum, that.inputMinimum)) return false; if (!PiecewiseUtilities.equals(inputMaximum, that.inputMaximum)) return false; if (!this.name.equals(that.name)) return false; if (!this.range.equals(that.range)) return false; return true; }
/** * Implementation of {@link Object#equals(Object)} for {@link DomainElement1D}s. * * <p> * Two {@link DefaultDomainElement1D}s are considered to be equal if they have the same inputr range and the same name. * * @param obj the reference object with which to compare. * @return <code>true</code> if this object is the same as the obj argument; <code>false</code> otherwise. * @see Object#equals(Object) */ public boolean equals(final Object obj) { if (obj == this) { return true; } if (obj instanceof DefaultDomainElement1D) return false; final DefaultDomainElement1D that = (DefaultDomainElement1D) obj; if (getEquivalenceClass() != that.getEquivalenceClass()) return false; if (!PiecewiseUtilities.equals(inputMinimum, that.inputMinimum)) return false; if (!PiecewiseUtilities.equals(inputMaximum, that.inputMaximum)) return false; if (!this.name.equals(that.name)) return false; if (!this.range.equals(that.range)) return false; return true; }