Top Description Fields Constructors Methods
com.ibm.icu.impl.number

public Class MixedUnitLongNameHandler

extends Object
implements MicroPropsGenerator, ModifierStore, ParentlessMicroPropsGenerator
Class Inheritance
All Implemented Interfaces
com.ibm.icu.impl.number.LongNameMultiplexer.ParentlessMicroPropsGenerator, com.ibm.icu.impl.number.ModifierStore, com.ibm.icu.impl.number.MicroPropsGenerator
Imports
java.util.ArrayList, .List, com.ibm.icu.impl.FormattedStringBuilder, .SimpleFormatterImpl, .StandardPlural, com.ibm.icu.number.LocalizedNumberFormatter, .NumberFormatter, com.ibm.icu.text.ListFormatter, .PluralRules, .SimpleFormatter, com.ibm.icu.util.MeasureUnit, .ULocale

Similar to LongNameHandler, but only for MIXED units.

Field Summary

Modifier and TypeField and Description
private LocalizedNumberFormatter
fIntegerFormatter

A localized NumberFormatter used to format the integer-valued bigger units of Mixed Unit measurements.

private ListFormatter
fListFormatter

A localised list formatter for joining mixed units together.

private List<String[]>
fMixedUnitData

Stores unit data for each of the individual units.

private final MicroPropsGenerator
private final PluralRules

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static MixedUnitLongNameHandler
forMeasureUnit(ULocale
The desired locale.
locale
,
MeasureUnit
The mixed measure unit to construct a MixedUnitLongNameHandler for.
mixedUnit
,
NumberFormatter.UnitWidth
Specifies the desired unit rendering.
width
,
String
Specifies the desired grammatical case. If the specified case is not found, we fall back to nominative or no-case.
unitDisplayCase
,
PluralRules
PluralRules instance.
rules
,
MicroPropsGenerator
MicroPropsGenerator instance.
parent
)

Construct a localized MixedUnitLongNameHandler for the specified MeasureUnit.

private Modifier
getMixedUnitModifier(DecimalQuantity quantity, MicroProps micros)

Deprecated as a consequence of DecimalQuantity being deprecated.
For a mixed unit, returns a Modifier that takes only one parameter: the smallest and final unit of the set.
public Modifier
getModifier(Modifier.Signum signum, StandardPlural plural)

Implements com.ibm.icu.impl.number.ModifierStore.getModifier.

Required for ModifierStore.
public MicroProps
processQuantity(DecimalQuantity
The quantity for consideration and optional mutation.
quantity
)

Implements com.ibm.icu.impl.number.MicroPropsGenerator.processQuantity.

Deprecated as a consequence of DecimalQuantity being deprecated.
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.
public MicroProps
processQuantityWithMicros(DecimalQuantity quantity, MicroProps micros)

Implements com.ibm.icu.impl.number.LongNameMultiplexer.ParentlessMicroPropsGenerator.processQuantityWithMicros.

Deprecated as a consequence of DecimalQuantity being deprecated.
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.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fIntegerFormatterback to summary
private LocalizedNumberFormatter fIntegerFormatter

A localized NumberFormatter used to format the integer-valued bigger units of Mixed Unit measurements.

fListFormatterback to summary
private ListFormatter fListFormatter

A localised list formatter for joining mixed units together.

fMixedUnitDataback to summary
private List<String[]> fMixedUnitData

Stores unit data for each of the individual units. For each unit, it stores ARRAY_LENGTH strings, as returned by getMeasureData.

parentback to summary
private final MicroPropsGenerator parent
rulesback to summary
private final PluralRules rules

Constructor Detail

MixedUnitLongNameHandlerback to summary
private MixedUnitLongNameHandler(PluralRules rules, MicroPropsGenerator parent)

Method Detail

forMeasureUnitback to summary
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:ULocale

The desired locale.

mixedUnit:MeasureUnit

The mixed measure unit to construct a MixedUnitLongNameHandler for.

width:NumberFormatter.UnitWidth

Specifies the desired unit rendering.

unitDisplayCase:String

Specifies the desired grammatical case. If the specified case is not found, we fall back to nominative or no-case.

rules:PluralRules

PluralRules instance.

parent:MicroPropsGenerator

MicroPropsGenerator instance.

getMixedUnitModifierback to summary
private Modifier getMixedUnitModifier(DecimalQuantity quantity, MicroProps micros)

Deprecated

as a consequence of DecimalQuantity being deprecated. See corresponding docs for further information.

For a mixed unit, returns a Modifier that takes only one parameter: the smallest and final unit of the set. The bigger units' values and labels get baked into this Modifier, together with the unit label of the final unit.

getModifierback to summary
public Modifier getModifier(Modifier.Signum signum, StandardPlural plural)

Implements com.ibm.icu.impl.number.ModifierStore.getModifier.

Required for ModifierStore. And ModifierStore is required by SimpleModifier constructor's last parameter. We assert his will never get called though.

Annotations
@Override
processQuantityback to summary
public MicroProps processQuantity(DecimalQuantity quantity)

Implements com.ibm.icu.impl.number.MicroPropsGenerator.processQuantity.

Deprecated

as a consequence of DecimalQuantity being deprecated. See corresponding docs for further information.

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. This function must not be called if this instance has no parent: call processQuantityWithMicros() instead.

Parameters
quantity:DecimalQuantity

Doc from com.ibm.icu.impl.number.MicroPropsGenerator.processQuantity.

The quantity for consideration and optional mutation.

Returns:MicroProps

Doc from com.ibm.icu.impl.number.MicroPropsGenerator.processQuantity.

A MicroProps instance resolved for the quantity.

Annotations
@Override
processQuantityWithMicrosback to summary
public MicroProps processQuantityWithMicros(DecimalQuantity quantity, MicroProps micros)

Implements com.ibm.icu.impl.number.LongNameMultiplexer.ParentlessMicroPropsGenerator.processQuantityWithMicros.

Deprecated

as a consequence of DecimalQuantity being deprecated. See corresponding docs for further information.

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. Does not call parent.processQuantity, so cannot get a MicroProps instance that way. Instead, the instance is passed in as a parameter.