/** * 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); }
System.out.println("secondPerMeter = \"" + secondPerMeter + '"'); System.out.println("meterPerSecond.isReciprocalOf(secondPerMeter)=" + meterPerSecond.isReciprocalOf(secondPerMeter)); System.out.println("meter.toDerivedUnit(1.0)=" + meter.toDerivedUnit(1.0));
System.out.println("secondPerMeter = \"" + secondPerMeter + '"'); System.out.println("meterPerSecond.isReciprocalOf(secondPerMeter)=" + meterPerSecond.isReciprocalOf(secondPerMeter)); System.out.println("meter.toDerivedUnit(1.0)=" + meter.toDerivedUnit(1.0));