private static UnitConverter valueOf(double offset) { float asFloat = (float) offset; return asFloat == 0.0f ? UnitConverter.IDENTITY : new AddConverter(offset); }
@Override public UnitConverter inverse() { return new AddConverter(- _offset); }
private static UnitConverter valueOf(double offset) { float asFloat = (float) offset; return asFloat == 0.0f ? UnitConverter.IDENTITY : new AddConverter(offset); }
private static UnitConverter valueOf(double offset) { float asFloat = (float) offset; return asFloat == 0.0f ? UnitConverter.IDENTITY : new AddConverter(offset); }
@Override public UnitConverter inverse() { return new AddConverter(- _offset); }
@Override public UnitConverter inverse() { return new AddConverter(- _offset); }
/** * Returns the result of adding an offset to this unit. The returned unit * is convertible with all units that are convertible with this unit. * * @param offset the offset added (expressed in this unit, * e.g. <code>CELSIUS = KELVIN.plus(273.15)</code>). * @return <code>this.transform(new AddConverter(offset))</code> */ public final Unit<Q> plus(double offset) { return transform(new AddConverter(offset)); }
/** * Returns the result of adding an offset to this unit. The returned unit * is convertible with all units that are convertible with this unit. * * @param offset the offset added (expressed in this unit, * e.g. <code>CELSIUS = KELVIN.plus(273.15)</code>). * @return <code>this.transform(new AddConverter(offset))</code> */ public final Unit<Q> plus(double offset) { return transform(new AddConverter(offset)); }
/** * Returns the result of adding an offset to this unit. The returned unit * is convertible with all units that are convertible with this unit. * * @param offset the offset added (expressed in this unit, * e.g. <code>CELSIUS = KELVIN.plus(273.15)</code>). * @return <code>this.transform(new AddConverter(offset))</code> */ public final Unit<Q> plus(double offset) { return transform(new AddConverter(offset)); }