/** * Indicates if this Dimension is the reciprocal of another dimension. * * @param that * The other dimension. * @return <code>true</code> if and only if this dimension is the reciprocal * of the other dimension. */ public final boolean isReciprocalOf(final Dimension that) { final Factor[] theseFactors = _factors; final Factor[] thoseFactors = that._factors; boolean isReciprocalOf; if (theseFactors.length != thoseFactors.length) { isReciprocalOf = false; } else { int i; for (i = theseFactors.length; --i >= 0;) { if (!theseFactors[i].isReciprocalOf(thoseFactors[i])) { break; } } isReciprocalOf = i < 0; } return isReciprocalOf; }
/** * Indicates if this Dimension is the reciprocal of another dimension. * * @param that * The other dimension. * @return <code>true</code> if and only if this dimension is the reciprocal * of the other dimension. */ public final boolean isReciprocalOf(final Dimension that) { final Factor[] theseFactors = _factors; final Factor[] thoseFactors = that._factors; boolean isReciprocalOf; if (theseFactors.length != thoseFactors.length) { isReciprocalOf = false; } else { int i; for (i = theseFactors.length; --i >= 0;) { if (!theseFactors[i].isReciprocalOf(thoseFactors[i])) { break; } } isReciprocalOf = i < 0; } return isReciprocalOf; }