public class MixedUnitLongNameHandler extends Object implements MicroPropsGenerator, ModifierStore, LongNameMultiplexer.ParentlessMicroPropsGenerator
| Modifier and Type | Method and Description |
|---|---|
static MixedUnitLongNameHandler |
forMeasureUnit(ULocale locale,
MeasureUnit mixedUnit,
NumberFormatter.UnitWidth width,
String unitDisplayCase,
PluralRules rules,
MicroPropsGenerator parent)
Construct a localized MixedUnitLongNameHandler for the specified
MeasureUnit.
|
Modifier |
getModifier(Modifier.Signum signum,
StandardPlural plural)
Required for ModifierStore.
|
MicroProps |
processQuantity(DecimalQuantity quantity)
Produces a plural-appropriate Modifier for a mixed unit:
quantity is
taken as the final smallest unit, while the larger unit values must be
provided by micros.mixedMeasures, micros being the MicroProps instance
returned by the parent. |
MicroProps |
processQuantityWithMicros(DecimalQuantity quantity,
MicroProps micros)
Produces a plural-appropriate Modifier for a mixed unit:
quantity is
taken as the final smallest unit, while the larger unit values must be
provided via micros.mixedMeasures. |
public static MixedUnitLongNameHandler forMeasureUnit(ULocale locale, MeasureUnit mixedUnit, NumberFormatter.UnitWidth width, String unitDisplayCase, PluralRules rules, MicroPropsGenerator parent)
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.public MicroProps processQuantity(DecimalQuantity quantity)
quantity is
taken as the final smallest unit, while the larger unit values must be
provided by micros.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.processQuantity in interface MicroPropsGeneratorquantity - The quantity for consideration and optional mutation.public MicroProps processQuantityWithMicros(DecimalQuantity quantity, MicroProps micros)
quantity is
taken as the final smallest unit, while the larger unit values must be
provided via micros.mixedMeasures.
Does not call parent.processQuantity, so cannot get a MicroProps instance
that way. Instead, the instance is passed in as a parameter.processQuantityWithMicros in interface LongNameMultiplexer.ParentlessMicroPropsGeneratorpublic Modifier getModifier(Modifier.Signum signum, StandardPlural plural)
getModifier in interface ModifierStore