public class LongNameHandler extends Object implements MicroPropsGenerator, ModifierStore, LongNameMultiplexer.ParentlessMicroPropsGenerator
| Modifier and Type | Method and Description |
|---|---|
static LongNameHandler |
forCurrencyLongNames(ULocale locale,
Currency currency,
PluralRules rules,
MicroPropsGenerator parent) |
static LongNameHandler |
forMeasureUnit(ULocale locale,
MeasureUnit unit,
NumberFormatter.UnitWidth width,
String unitDisplayCase,
PluralRules rules,
MicroPropsGenerator parent)
Construct a localized LongNameHandler for the specified MeasureUnit.
|
Modifier |
getModifier(Modifier.Signum signum,
StandardPlural plural)
Returns a Modifier with the given parameters (best-effort).
|
static String |
getUnitDisplayName(ULocale locale,
MeasureUnit unit,
NumberFormatter.UnitWidth width) |
MicroProps |
processQuantity(DecimalQuantity quantity)
Considers the given
DecimalQuantity, optionally mutates it, and returns a
MicroProps. |
MicroProps |
processQuantityWithMicros(DecimalQuantity quantity,
MicroProps micros)
Produces a plural-appropriate Modifier for a unit:
quantity is taken as
the final smallest unit, while the larger unit values must be provided
via micros.mixedMeasures. |
public static String getUnitDisplayName(ULocale locale, MeasureUnit unit, NumberFormatter.UnitWidth width)
public static LongNameHandler forCurrencyLongNames(ULocale locale, Currency currency, PluralRules rules, MicroPropsGenerator parent)
public static LongNameHandler forMeasureUnit(ULocale locale, MeasureUnit unit, NumberFormatter.UnitWidth width, String unitDisplayCase, PluralRules rules, MicroPropsGenerator parent)
Mixed units are not supported, use MixedUnitLongNameHandler.forMeasureUnit.
locale - The desired locale.unit - The measure unit to construct a LongNameHandler 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 - Plural rules.parent - Plural rules.public MicroProps processQuantity(DecimalQuantity quantity)
MicroPropsGeneratorDecimalQuantity, optionally mutates it, and returns a
MicroProps.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)
ModifierStoregetModifier in interface ModifierStore