/** * Divides this unit dimension by another. * @param that The other unit dimension. * @return The quotient of this unit dimension divided * by the other. */ public UnitDimension divideBy(UnitDimension that) { return multiplyBy(that.raiseTo(-1)); }
/** * Divides this unit dimension by another. * @param that The other unit dimension. * @return The quotient of this unit dimension divided * by the other. */ public UnitDimension divideBy(UnitDimension that) { return multiplyBy(that.raiseTo(-1)); }
/** * Multiplies this derived unit by another. * * @param that * The other unit. * @return The product of the two units. * @throws MultiplyException * Can't multiply these units. */ @Override protected Unit myMultiplyBy(final Unit that) throws MultiplyException { Unit result; if (dimension.getRank() == 0) { result = that; } else { if (!(that instanceof DerivedUnit)) { result = that.multiplyBy(this); } else { final UnitDimension thatDimension = ((DerivedUnit) that) .getDimension(); result = thatDimension.getRank() == 0 ? this : new DerivedUnitImpl(dimension .multiplyBy(thatDimension)); } } return result; }
/** * Multiplies this derived unit by another. * * @param that * The other unit. * @return The product of the two units. * @throws MultiplyException * Can't multiply these units. */ @Override protected Unit myMultiplyBy(final Unit that) throws MultiplyException { Unit result; if (dimension.getRank() == 0) { result = that; } else { if (!(that instanceof DerivedUnit)) { result = that.multiplyBy(this); } else { final UnitDimension thatDimension = ((DerivedUnit) that) .getDimension(); result = thatDimension.getRank() == 0 ? this : new DerivedUnitImpl(dimension .multiplyBy(thatDimension)); } } return result; }