@Override public UnitConverter inverse() { return _dividend < 0 ? new RationalConverter(-_divisor, -_dividend) : new RationalConverter(_divisor, _dividend); }
@Override public UnitConverter inverse() { return _dividend < 0 ? new RationalConverter(-_divisor, -_dividend) : new RationalConverter(_divisor, _dividend); }
@Override public UnitConverter inverse() { return _dividend < 0 ? new RationalConverter(-_divisor, -_dividend) : new RationalConverter(_divisor, _dividend); }
private static UnitConverter valueOf(long dividend, long divisor) { return (dividend == 1L) && (divisor == 1L) ? UnitConverter.IDENTITY : new RationalConverter(dividend, divisor); }
private static UnitConverter valueOf(long dividend, long divisor) { return (dividend == 1L) && (divisor == 1L) ? UnitConverter.IDENTITY : new RationalConverter(dividend, divisor); }
private static UnitConverter valueOf(long dividend, long divisor) { return (dividend == 1L) && (divisor == 1L) ? UnitConverter.IDENTITY : new RationalConverter(dividend, divisor); }
/** * Returns the result of multiplying this unit by an exact factor. * * @param factor the exact scale factor * (e.g. <code>KILOMETER = METER.times(1000)</code>). * @return <code>this.transform(new RationalConverter(factor, 1))</code> */ public final Unit<Q> times(long factor) { return transform(new RationalConverter(factor, 1)); }
/** * Returns the result of multiplying this unit by an exact factor. * * @param factor the exact scale factor * (e.g. <code>KILOMETER = METER.times(1000)</code>). * @return <code>this.transform(new RationalConverter(factor, 1))</code> */ public final Unit<Q> times(long factor) { return transform(new RationalConverter(factor, 1)); }
/** * Returns the result of multiplying this unit by an exact factor. * * @param factor the exact scale factor * (e.g. <code>KILOMETER = METER.times(1000)</code>). * @return <code>this.transform(new RationalConverter(factor, 1))</code> */ public final Unit<Q> times(long factor) { return transform(new RationalConverter(factor, 1)); }
public UnitConverter getTransform(BaseUnit<?> unit) { if (unit.equals(SI.CANDELA)) return new RationalConverter(1, 683); return UnitConverter.IDENTITY; } };
/** * Returns the result of dividing this unit by an exact divisor. * * @param divisor the exact divisor. * (e.g. <code>QUART = GALLON_LIQUID_US.divide(4)</code>). * @return <code>this.transform(new RationalConverter(1 , divisor))</code> */ public final Unit<Q> divide(long divisor) { return transform(new RationalConverter(1, divisor)); }
public UnitConverter getTransform(BaseUnit<?> unit) { if (unit.equals(SI.CANDELA)) return new RationalConverter(1, 683); return UnitConverter.IDENTITY; } };
public UnitConverter getTransform(BaseUnit<?> unit) { if (unit.equals(SI.CANDELA)) return new RationalConverter(1, 683); return UnitConverter.IDENTITY; } };
/** * Returns the result of dividing this unit by an exact divisor. * * @param divisor the exact divisor. * (e.g. <code>QUART = GALLON_LIQUID_US.divide(4)</code>). * @return <code>this.transform(new RationalConverter(1 , divisor))</code> */ public final Unit<Q> divide(long divisor) { return transform(new RationalConverter(1, divisor)); }
/** * Returns the result of dividing this unit by an exact divisor. * * @param divisor the exact divisor. * (e.g. <code>QUART = GALLON_LIQUID_US.divide(4)</code>). * @return <code>this.transform(new RationalConverter(1 , divisor))</code> */ public final Unit<Q> divide(long divisor) { return transform(new RationalConverter(1, divisor)); }