Class MixedUnitLongNameHandler
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.impl.number.MixedUnitLongNameHandler
- All Implemented Interfaces:
LongNameMultiplexer.ParentlessMicroPropsGenerator, MicroPropsGenerator, ModifierStore
public class MixedUnitLongNameHandler
extends Object
implements MicroPropsGenerator, ModifierStore, LongNameMultiplexer.ParentlessMicroPropsGenerator
Similar to LongNameHandler, but only for MIXED units.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MixedUnitLongNameHandlerforMeasureUnit(ULocale locale, MeasureUnit mixedUnit, NumberFormatter.UnitWidth width, String unitDisplayCase, PluralRules rules, MicroPropsGenerator parent) Construct a localized MixedUnitLongNameHandler for the specified MeasureUnit.getModifier(Modifier.Signum signum, StandardPlural plural) Required for ModifierStore.processQuantity(DecimalQuantity quantity) Produces a plural-appropriate Modifier for a mixed unit:quantityis taken as the final smallest unit, while the larger unit values must be provided bymicros.mixedMeasures, micros being the MicroProps instance returned by the parent.processQuantityWithMicros(DecimalQuantity quantity, MicroProps micros) Produces a plural-appropriate Modifier for a mixed unit:quantityis taken as the final smallest unit, while the larger unit values must be provided viamicros.mixedMeasures.
-
Method Details
-
forMeasureUnit
public static MixedUnitLongNameHandler forMeasureUnit(ULocale locale, MeasureUnit mixedUnit, NumberFormatter.UnitWidth width, String unitDisplayCase, PluralRules rules, MicroPropsGenerator parent) Construct a localized MixedUnitLongNameHandler for the specified MeasureUnit. It must be a MIXED unit.- Parameters:
locale- The desired locale.mixedUnit- The mixed measure unit to construct a MixedUnitLongNameHandler for.width- Specifies the desired unit rendering.unitDisplayCase- Specifies the desired grammatical case. If the specified case is not found, we fall back to nominative or no-case.rules- PluralRules instance.parent- MicroPropsGenerator instance.
-
processQuantity
Produces a plural-appropriate Modifier for a mixed unit:quantityis taken as the final smallest unit, while the larger unit values must be provided bymicros.mixedMeasures, micros being the MicroProps instance returned by the parent. This function must not be called if this instance has no parent: call processQuantityWithMicros() instead.- Specified by:
processQuantityin interfaceMicroPropsGenerator- Parameters:
quantity- The quantity for consideration and optional mutation.- Returns:
- A MicroProps instance resolved for the quantity.
-
processQuantityWithMicros
Produces a plural-appropriate Modifier for a mixed unit:quantityis taken as the final smallest unit, while the larger unit values must be provided viamicros.mixedMeasures. Does not call parent.processQuantity, so cannot get a MicroProps instance that way. Instead, the instance is passed in as a parameter.- Specified by:
processQuantityWithMicrosin interfaceLongNameMultiplexer.ParentlessMicroPropsGenerator
-
getModifier
Required for ModifierStore. And ModifierStore is required by SimpleModifier constructor's last parameter. We assert his will never get called though.- Specified by:
getModifierin interfaceModifierStore
-