Package com.ibm.icu.impl.number
Class UsagePrefsHandler
java.lang.Object
com.ibm.icu.impl.number.UsagePrefsHandler
- All Implemented Interfaces:
MicroPropsGenerator
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUsagePrefsHandler
(ULocale locale, MeasureUnit inputUnit, String usage, MicroPropsGenerator parent) -
Method Summary
Modifier and TypeMethodDescriptionReturns 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.processQuantity
(DecimalQuantity quantity) Obtains the appropriate output value, MeasureUnit and rounding/precision behaviour from the UnitsRouter.
-
Field Details
-
fParent
-
fUnitsRouter
-
-
Constructor Details
-
UsagePrefsHandler
public UsagePrefsHandler(ULocale locale, MeasureUnit inputUnit, String usage, MicroPropsGenerator parent)
-
-
Method Details
-
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
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
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.
-