/** * Indicates if this derived unit is semantically identical to an object. * * @param object * The object * @return <code>true</code> if and only if this derived unit is * semantically identical to <code> * object</code>. */ @Override public boolean equals(final Object object) { if (this == object) { return true; } if (!(object instanceof DerivedUnit)) { return false; } final DerivedUnit that = (DerivedUnit) object; return (this instanceof BaseUnit && that instanceof BaseUnit) ? false : dimension.equals(that.getDimension()); }
/** * Indicates if this derived unit is semantically identical to an object. * * @param object * The object * @return <code>true</code> if and only if this derived unit is * semantically identical to <code> * object</code>. */ @Override public boolean equals(final Object object) { if (this == object) { return true; } if (!(object instanceof DerivedUnit)) { return false; } final DerivedUnit that = (DerivedUnit) object; return (this instanceof BaseUnit && that instanceof BaseUnit) ? false : dimension.equals(that.getDimension()); }