Package com.ibm.icu.impl.number
Class UnitConversionHandler
- java.lang.Object
-
- com.ibm.icu.impl.number.UnitConversionHandler
-
- All Implemented Interfaces:
MicroPropsGenerator
public class UnitConversionHandler extends java.lang.Object implements MicroPropsGenerator
A MicroPropsGenerator which converts a measurement from one MeasureUnit to another. In particular, the output MeasureUnit may be a mixed unit. (The input unit may not be a mixed unit.)
-
-
Field Summary
Fields Modifier and Type Field Description private ComplexUnitsConverter
fComplexUnitConverter
private MeasureUnit
fOutputUnit
private MicroPropsGenerator
fParent
-
Constructor Summary
Constructors Constructor Description UnitConversionHandler(MeasureUnit targetUnit, MicroPropsGenerator parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MicroProps
processQuantity(DecimalQuantity quantity)
Obtains the appropriate output values from the Unit Converter.
-
-
-
Field Detail
-
fParent
private final MicroPropsGenerator fParent
-
fOutputUnit
private MeasureUnit fOutputUnit
-
fComplexUnitConverter
private ComplexUnitsConverter fComplexUnitConverter
-
-
Constructor Detail
-
UnitConversionHandler
public UnitConversionHandler(MeasureUnit targetUnit, MicroPropsGenerator parent)
- Parameters:
targetUnit
- Specifies the output MeasureUnit. The input MeasureUnit is derived from it: in case of a mixed unit, the biggest unit is taken as the input unit. If not a mixed unit, the input unit will be the same as the output unit and no unit conversion takes place.parent
- The parent MicroPropsGenerator.
-
-
Method Detail
-
processQuantity
public MicroProps processQuantity(DecimalQuantity quantity)
Obtains the appropriate output values from the Unit Converter.- Specified by:
processQuantity
in interfaceMicroPropsGenerator
- Parameters:
quantity
- The quantity for consideration and optional mutation.- Returns:
- A MicroProps instance resolved for the quantity.
-
-