/** * Returns the canonical string representation of the unit. * * @return The canonical string representation. */ public String getCanonicalString() { return DerivedUnitImpl.DIMENSIONLESS.equals(_unit) ? Double.toString(getScale()) : Double.toString(getScale()) + " " + _unit.toString(); }
/** * Returns the canonical string representation of the unit. * * @return The canonical string representation. */ public String getCanonicalString() { return DerivedUnitImpl.DIMENSIONLESS.equals(_unit) ? Double.toString(getScale()) : Double.toString(getScale()) + " " + _unit.toString(); }
/** * Indicates if values in this unit are convertible with another unit. * * @param that * The other unit. * @return <code>true</code> if and only if values in this unit are * convertible to values in <code> * that</code>. */ @Override public final boolean isCompatible(final Unit that) { final DerivedUnit unit = that.getDerivedUnit(); return equals(unit) || isReciprocalOf(unit); }
/** * Indicates if values in this unit are convertible with another unit. * * @param that * The other unit. * @return <code>true</code> if and only if values in this unit are * convertible to values in <code> * that</code>. */ @Override public final boolean isCompatible(final Unit that) { final DerivedUnit unit = that.getDerivedUnit(); return equals(unit) || isReciprocalOf(unit); }