Package com.ibm.icu.impl.number
Class UsagePrefsHandler
- java.lang.Object
-
- com.ibm.icu.impl.number.UsagePrefsHandler
-
- All Implemented Interfaces:
MicroPropsGenerator
public class UsagePrefsHandler extends java.lang.Object implements MicroPropsGenerator
-
-
Field Summary
Fields Modifier and Type Field Description private MicroPropsGenerator
fParent
private UnitsRouter
fUnitsRouter
-
Constructor Summary
Constructors Constructor Description UsagePrefsHandler(ULocale locale, MeasureUnit inputUnit, java.lang.String usage, MicroPropsGenerator parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<MeasureUnit>
getOutputUnits()
Returns the list of possible output units, i.e.protected static void
mixedMeasuresToMicros(ComplexUnitsConverter.ComplexConverterResult complexConverterResult, DecimalQuantity quantity, MicroProps outMicros)
Populates micros.mixedMeasures and modifies quantity, based on the values in measures.MicroProps
processQuantity(DecimalQuantity quantity)
Obtains the appropriate output value, MeasureUnit and rounding/precision behaviour from the UnitsRouter.
-
-
-
Field Detail
-
fParent
private final MicroPropsGenerator fParent
-
fUnitsRouter
private UnitsRouter fUnitsRouter
-
-
Constructor Detail
-
UsagePrefsHandler
public UsagePrefsHandler(ULocale locale, MeasureUnit inputUnit, java.lang.String usage, MicroPropsGenerator parent)
-
-
Method Detail
-
mixedMeasuresToMicros
protected static void mixedMeasuresToMicros(ComplexUnitsConverter.ComplexConverterResult complexConverterResult, DecimalQuantity quantity, MicroProps outMicros)
Populates micros.mixedMeasures and modifies quantity, based on the values in measures.
-
getOutputUnits
public java.util.List<MeasureUnit> getOutputUnits()
Returns the list of possible output units, i.e. the full set of preferences, for the localized, usage-specific unit preferences.The returned pointer should be valid for the lifetime of the UsagePrefsHandler instance.
-
processQuantity
public MicroProps processQuantity(DecimalQuantity quantity)
Obtains the appropriate output value, MeasureUnit and rounding/precision behaviour from the UnitsRouter.The output unit is passed on to the LongNameHandler via micros.outputUnit.
- Specified by:
processQuantity
in interfaceMicroPropsGenerator
- Parameters:
quantity
- The quantity for consideration and optional mutation.- Returns:
- A MicroProps instance resolved for the quantity.
-
-