Class UsagePrefsHandler
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.impl.number.UsagePrefsHandler
- All Implemented Interfaces:
MicroPropsGenerator
-
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 voidmixedMeasuresToMicros(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.
-
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:
processQuantityin interfaceMicroPropsGenerator- Parameters:
quantity- The quantity for consideration and optional mutation.- Returns:
- A MicroProps instance resolved for the quantity.
-