| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | LongNameHandler.DerivedComponents
Loads and applies deriveComponent rules from CLDR's grammaticalFeatures.xml. |
| private static class | |
| private static class | |
| private static enum | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | |
| private static final int | |
| private String | |
| private static final int | |
| private static int | |
| private final Map | |
| private final MicroPropsGenerator | |
| private static final int | |
| private final PluralRules |
| Access | Constructor and Description |
|---|---|
| private | LongNameHandler(Map<StandardPlural, SimpleModifier> modifiers, PluralRules rules, MicroPropsGenerator parent)
|
| Modifier and Type | Method and Description |
|---|---|
| private static String | Returns: The gender string for the unit, or an empty string if unknown or ungendered.The desired locale. locale, MeasureUnit The measure unit to calculate the gender for. unit)Calculates the gender of an arbitrary unit: this is the *second* implementation of an algorithm to do this: Gender is also calculated in "processPatternTimes": that code path is "bottom up", loading the gender for every component of a compound unit (at the same time as loading the Long Names formatting patterns), even if the gender is unneeded, then combining the single units' genders into the compound unit's gender, according to the rules. |
| private static LongNameHandler. | extractCorePattern(String
is extracted as per Extract(...) in the spec:
https://unicode.org/reports/tr35/tr35-general.html#compound-units pattern)Returns three outputs extracted from pattern. |
| private static LongNameHandler | forArbitraryUnit(ULocale loc, MeasureUnit unit, NumberFormatter.
|
| public static LongNameHandler | forCurrencyLongNames(ULocale locale, Currency currency, PluralRules rules, MicroPropsGenerator parent)
|
| public static LongNameHandler | forMeasureUnit(ULocale
The desired locale. locale, MeasureUnit The measure unit to construct a LongNameHandler for. unit, NumberFormatter.Specifies the desired unit rendering. width,Specifies the desired grammatical case. If the
specified case is not found, we fall back to nominative or no-case. unitDisplayCase, PluralRules Plural rules. rules, MicroPropsGenerator Plural rules. parent)Construct a localized LongNameHandler for the specified MeasureUnit. |
| private static String | |
| private static void | |
| private static String | getDeriveCompoundRule(ULocale locale, String feature, String structure)
Loads and returns the value in rules that look like these: <deriveCompound feature="gender" structure="per" value="0"/> <deriveCompound feature="gender" structure="times" value="1"/> Currently a fake example, but spec compliant: <deriveCompound feature="gender" structure="power" value="feminine"/> NOTE: If U_FAILURE(status), returns an empty string. |
| private static String | |
| private static String | |
| private static int | |
| pack-priv static void | getInflectedMeasureData(String subKey, ULocale locale, NumberFormatter.
|
| pack-priv static void | getMeasureData(ULocale locale, MeasureUnit unit, NumberFormatter.
|
| public Modifier | getModifier(Modifier.
Implements com. |
| public static String | |
| pack-priv static String | |
| private static void | |
| private void | multiSimpleFormatsToModifiers(String[] leadFormats, String trailFormat, NumberFormat.
Sets modifiers to a combination of |
| private static void | processPatternTimes(MeasureUnitImpl productUnit, ULocale loc, NumberFormatter.
Roughly corresponds to patternTimes(...) in the spec: https://unicode.org/reports/tr35/tr35-general.html#compound-units |
| public MicroProps | processQuantity(DecimalQuantity
The quantity for consideration and optional mutation. quantity)Implements com.
Deprecated
as a consequence of
Considers the given DecimalQuantity being deprecated.
DecimalQuantity, optionally mutates it, and returns a
MicroProps.
|
| public MicroProps | processQuantityWithMicros(DecimalQuantity quantity, MicroProps micros)
Implements com.
Deprecated
as a consequence of
Produces a plural-appropriate Modifier for a unit: DecimalQuantity being deprecated.
quantity is taken as
the final smallest unit, while the larger unit values must be provided
via micros.mixedMeasures.
|
| private void | simpleFormatsToModifiers(String[] simpleFormats, NumberFormat.
Sets modifiers to use the patterns from simpleFormats. |
| ARRAY_LENGTH | back to summary |
|---|---|
| pack-priv static final int ARRAY_LENGTH | |
| DNAM_INDEX | back to summary |
|---|---|
| private static final int DNAM_INDEX | |
| gender | back to summary |
|---|---|
| private String gender | |
| GENDER_INDEX | back to summary |
|---|---|
| private static final int GENDER_INDEX | |
| i | back to summary |
|---|---|
| private static int i | |
| modifiers | back to summary |
|---|---|
| private final Map<StandardPlural, SimpleModifier> modifiers | |
| parent | back to summary |
|---|---|
| private final MicroPropsGenerator parent | |
| PER_INDEX | back to summary |
|---|---|
| private static final int PER_INDEX | |
| rules | back to summary |
|---|---|
| private final PluralRules rules | |
| LongNameHandler | back to summary |
|---|---|
| private LongNameHandler(Map<StandardPlural, SimpleModifier> modifiers, PluralRules rules, MicroPropsGenerator parent) | |
| calculateGenderForUnit | back to summary |
|---|---|
| private static String calculateGenderForUnit(ULocale locale, MeasureUnit unit) Calculates the gender of an arbitrary unit: this is the *second* implementation of an algorithm to do this: Gender is also calculated in "processPatternTimes": that code path is "bottom up", loading the gender for every component of a compound unit (at the same time as loading the Long Names formatting patterns), even if the gender is unneeded, then combining the single units' genders into the compound unit's gender, according to the rules. This algorithm does a lazier "top-down" evaluation, starting with the compound unit, calculating which single unit's gender is needed by breaking it down according to the rules, and then loading only the gender of the one single unit who's gender is needed. For future refactorings: 1. we could drop processPatternTimes' gender calculation and just call this function: for UNUM_UNIT_WIDTH_FULL_NAME, the unit gender is in the very same table as the formatting patterns, so loading it then may be efficient. For other unit widths however, it needs to be explicitly looked up anyway. 2. alternatively, if CLDR is providing all the genders we need such that we don't need to calculate them in ICU anymore, we could drop this function and keep only processPatternTimes' calculation. (And optimise it a bit?)
| |
| extractCorePattern | back to summary |
|---|---|
| private static LongNameHandler. Returns three outputs extracted from pattern.
| |
| forArbitraryUnit | back to summary |
|---|---|
| private static LongNameHandler forArbitraryUnit(ULocale loc, MeasureUnit unit, NumberFormatter. | |
| forCurrencyLongNames | back to summary |
|---|---|
| public static LongNameHandler forCurrencyLongNames(ULocale locale, Currency currency, PluralRules rules, MicroPropsGenerator parent) | |
| forMeasureUnit | back to summary |
|---|---|
| public static LongNameHandler forMeasureUnit(ULocale locale, MeasureUnit unit, NumberFormatter. Construct a localized LongNameHandler for the specified MeasureUnit. Mixed units are not supported, use MixedUnitLongNameHandler.forMeasureUnit.
| |
| getCompoundValue | back to summary |
|---|---|
| private static String getCompoundValue(String compoundKey, ULocale locale, NumberFormatter. | |
| getCurrencyLongNameData | back to summary |
|---|---|
| private static void getCurrencyLongNameData(ULocale locale, Currency currency, String[] outArray) | |
| getDeriveCompoundRule | back to summary |
|---|---|
| private static String getDeriveCompoundRule(ULocale locale, String feature, String structure) Loads and returns the value in rules that look like these: <deriveCompound feature="gender" structure="per" value="0"/> <deriveCompound feature="gender" structure="times" value="1"/> Currently a fake example, but spec compliant: <deriveCompound feature="gender" structure="power" value="feminine"/> NOTE: If U_FAILURE(status), returns an empty string. | |
| getDerivedGender | back to summary |
|---|---|
| private static String getDerivedGender(ULocale locale, String structure, String[] data0, String[] data1) | |
| getGenderForBuiltin | back to summary |
|---|---|
| private static String getGenderForBuiltin(ULocale locale, MeasureUnit builtinUnit) | |
| getIndex | back to summary |
|---|---|
| private static int getIndex(String pluralKeyword) | |
| getInflectedMeasureData | back to summary |
|---|---|
| pack-priv static void getInflectedMeasureData(String subKey, ULocale locale, NumberFormatter. | |
| getMeasureData | back to summary |
|---|---|
| pack-priv static void getMeasureData(ULocale locale, MeasureUnit unit, NumberFormatter. | |
| getModifier | back to summary |
|---|---|
| public Modifier getModifier(Modifier. Implements com. Doc from com. Returns a Modifier with the given parameters (best-effort).
| |
| getUnitDisplayName | back to summary |
|---|---|
| public static String getUnitDisplayName(ULocale locale, MeasureUnit unit, NumberFormatter. | |
| getWithPlural | back to summary |
|---|---|
| pack-priv static String getWithPlural(String[] strings, StandardPlural plural) | |
| maybeCalculateGender | back to summary |
|---|---|
| private static void maybeCalculateGender(ULocale locale, MeasureUnit unit, String[] outArray) | |
| multiSimpleFormatsToModifiers | back to summary |
|---|---|
| private void multiSimpleFormatsToModifiers(String[] leadFormats, String trailFormat, NumberFormat. Sets modifiers to a combination of | |
| processPatternTimes | back to summary |
|---|---|
| private static void processPatternTimes(MeasureUnitImpl productUnit, ULocale loc, NumberFormatter. Roughly corresponds to patternTimes(...) in the spec: https://unicode.org/reports/tr35/tr35-general.html#compound-units | |
| processQuantity | back to summary |
|---|---|
| public MicroProps processQuantity(DecimalQuantity quantity) Implements com. Doc from com. Deprecated as a consequence of Considers the given
| |
| processQuantityWithMicros | back to summary |
|---|---|
| public MicroProps processQuantityWithMicros(DecimalQuantity quantity, MicroProps micros) Implements com. Deprecated as a consequence of Produces a plural-appropriate Modifier for a unit:
| |
| simpleFormatsToModifiers | back to summary |
|---|---|
| private void simpleFormatsToModifiers(String[] simpleFormats, NumberFormat. Sets modifiers to use the patterns from simpleFormats. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | put(UResource.
Initially the key string of the enumeration-start resource.
Empty if the enumeration starts at the top level of the bundle.
Reuse for output values from Array and Table getters. key,Call getArray() or getTable() as appropriate.
Then reuse for output values from Array and Table getters. value,true if the bundle has no parent;
that is, its top-level table has the nofallback attribute,
or it is the root bundle of a locale tree. noFallback)Implements abstract com. |
| replacement | back to summary |
|---|---|
| pack-priv String replacement | |
| AliasSink | back to summary |
|---|---|
| private AliasSink() | |
| put | back to summary |
|---|---|
| public void put(UResource. Implements abstract com. Doc from com. Called once for each bundle (child-parent-...-root). The value is normally an array or table resource, and implementations of this method normally iterate over the tree of resource items stored there.
| |
Consider a deriveComponent rule that looks like this:
<deriveComponent feature="case" structure="per" value0="compound" value1="nominative"/>Instantiating an instance as follows:
DerivedComponents d(loc, "case", "per");
Applying the rule in the XML element above, d.value0("foo")
will be "foo", and d.value1("foo") will be "nominative".
In case of any kind of failure, value0() and value1() will simply return "".
| Access | Constructor and Description |
|---|---|
| pack-priv |
| value0 | back to summary |
|---|---|
| private String value0 | |
| value1 | back to summary |
|---|---|
| private String value1 | |
| DerivedComponents | back to summary |
|---|---|
| pack-priv DerivedComponents(ULocale locale, String feature, String structure) Constructor. | |
| value0 | back to summary |
|---|---|
| pack-priv String value0(String compoundValue) | |
| value1 | back to summary |
|---|---|
| pack-priv String value1(String compoundValue) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv String | |
| pack-priv char | |
| pack-priv LongNameHandler. |
| Access | Constructor and Description |
|---|---|
| private |
| coreUnit | back to summary |
|---|---|
| pack-priv String coreUnit | |
| joinerChar | back to summary |
|---|---|
| pack-priv char joinerChar | |
| placeholderPosition | back to summary |
|---|---|
| pack-priv LongNameHandler. | |
| ExtractCorePatternResult | back to summary |
|---|---|
| private ExtractCorePatternResult() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv String | |
| pack-priv String | |
| pack-priv String[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| private boolean | |
| private boolean | |
| public void | put(UResource.
Initially the key string of the enumeration-start resource.
Empty if the enumeration starts at the top level of the bundle.
Reuse for output values from Array and Table getters. key,Call getArray() or getTable() as appropriate.
Then reuse for output values from Array and Table getters. value,true if the bundle has no parent;
that is, its top-level table has the nofallback attribute,
or it is the root bundle of a locale tree. noFallback)Implements abstract com. |
| caseVariant | back to summary |
|---|---|
| pack-priv String caseVariant | |
| gender | back to summary |
|---|---|
| pack-priv String gender | |
| outArray | back to summary |
|---|---|
| pack-priv String[] outArray | |
| InflectedPluralSink | back to summary |
|---|---|
| public InflectedPluralSink(String gender, String caseVariant, String[] outArray) | |
| loadForCase | back to summary |
|---|---|
| private boolean loadForCase(UResource. | |
| loadForGender | back to summary |
|---|---|
| private boolean loadForGender(UResource. | |
| loadForPluralForm | back to summary |
|---|---|
| private boolean loadForPluralForm(UResource. | |
| put | back to summary |
|---|---|
| public void put(UResource. Implements abstract com. Doc from com. Called once for each bundle (child-parent-...-root). The value is normally an array or table resource, and implementations of this method normally iterate over the tree of resource items stored there.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final LongNameHandler. | |
| public static final LongNameHandler. | |
| public static final LongNameHandler. | |
| public static final LongNameHandler. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static LongNameHandler. | |
| public static LongNameHandler. |
| BEGINNING | back to summary |
|---|---|
| public static final LongNameHandler. | |
| END | back to summary |
|---|---|
| public static final LongNameHandler. | |
| MIDDLE | back to summary |
|---|---|
| public static final LongNameHandler. | |
| NONE | back to summary |
|---|---|
| public static final LongNameHandler. | |
| PlaceholderPosition | back to summary |
|---|---|
| private PlaceholderPosition() | |
| valueOf | back to summary |
|---|---|
| public static LongNameHandler. | |
| values | back to summary |
|---|---|
| public static LongNameHandler. | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | put(UResource.
Initially the key string of the enumeration-start resource.
Empty if the enumeration starts at the top level of the bundle.
Reuse for output values from Array and Table getters. key,Call getArray() or getTable() as appropriate.
Then reuse for output values from Array and Table getters. value,true if the bundle has no parent;
that is, its top-level table has the nofallback attribute,
or it is the root bundle of a locale tree. noFallback)Implements abstract com. |
| outArray | back to summary |
|---|---|
| pack-priv String[] outArray | |
| PluralTableSink | back to summary |
|---|---|
| public PluralTableSink(String[] outArray) | |
| put | back to summary |
|---|---|
| public void put(UResource. Implements abstract com. Doc from com. Called once for each bundle (child-parent-...-root). The value is normally an array or table resource, and implementations of this method normally iterate over the tree of resource items stored there.
| |