/** * Concatenates this converter with another converter. The resulting * converter is equivalent to first converting by the specified converter, * and then converting by this converter. * * <p>Note: Implementations must ensure that the {@link #IDENTITY} instance * is returned if the resulting converter is an identity * converter.</p> * * @param converter the other converter. * @return the concatenation of this converter with the other converter. */ public UnitConverter concatenate(UnitConverter converter) { return (converter == IDENTITY) ? this : new Compound(converter, this); }
static private UnitConverter getTransform(TransformedUnit<?> unit){ UnitConverter transform = unit.toParentUnit(); if(transform instanceof UnitConverter.Compound){ UnitConverter.Compound compoundTransform = (UnitConverter.Compound)transform; return compoundTransform.getRight(); } return transform; } }
/** * Concatenates this converter with another converter. The resulting * converter is equivalent to first converting by the specified converter, * and then converting by this converter. * * <p>Note: Implementations must ensure that the {@link #IDENTITY} instance * is returned if the resulting converter is an identity * converter.</p> * * @param converter the other converter. * @return the concatenation of this converter with the other converter. */ public UnitConverter concatenate(UnitConverter converter) { return (converter == IDENTITY) ? this : new Compound(converter, this); }
/** * Concatenates this converter with another converter. The resulting * converter is equivalent to first converting by the specified converter, * and then converting by this converter. * * <p>Note: Implementations must ensure that the {@link #IDENTITY} instance * is returned if the resulting converter is an identity * converter.</p> * * @param converter the other converter. * @return the concatenation of this converter with the other converter. */ public UnitConverter concatenate(UnitConverter converter) { return (converter == IDENTITY) ? this : new Compound(converter, this); }
@Override public UnitConverter inverse() { return new Compound(_second.inverse(), _first.inverse()); }
@Override public UnitConverter inverse() { return new Compound(_second.inverse(), _first.inverse()); }
@Override public UnitConverter inverse() { return new Compound(_second.inverse(), _first.inverse()); }