Package com.ibm.icu.impl.number
Class CompactData
java.lang.Object
com.ibm.icu.impl.number.CompactData
- All Implemented Interfaces:
MultiplierProducer
Datatype for compact notation data. Includes logic for data loading.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
static enum
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static final int
countZeros
(String patternString) private static final int
getIndex
(int magnitude, StandardPlural plural) int
getMultiplier
(int magnitude) Maps a magnitude to a multiplier in powers of ten.getPattern
(int magnitude, PluralRules rules, DecimalQuantity dq) private static void
getResourceBundleKey
(String nsName, CompactDecimalFormat.CompactStyle compactStyle, CompactData.CompactType compactType, StringBuilder sb) Produces a string like "NumberElements/latn/patternsShort/decimalFormat".void
getUniquePatterns
(Set<String> output) void
populate
(ULocale locale, String nsName, CompactDecimalFormat.CompactStyle compactStyle, CompactData.CompactType compactType) void
Java-only method used by CLDR tooling.
-
Field Details
-
USE_FALLBACK
- See Also:
-
patterns
-
multipliers
private final byte[] multipliers -
largestMagnitude
private byte largestMagnitude -
isEmpty
private boolean isEmpty -
COMPACT_MAX_DIGITS
private static final int COMPACT_MAX_DIGITS- See Also:
-
-
Constructor Details
-
CompactData
public CompactData()
-
-
Method Details
-
populate
public void populate(ULocale locale, String nsName, CompactDecimalFormat.CompactStyle compactStyle, CompactData.CompactType compactType) -
getResourceBundleKey
private static void getResourceBundleKey(String nsName, CompactDecimalFormat.CompactStyle compactStyle, CompactData.CompactType compactType, StringBuilder sb) Produces a string like "NumberElements/latn/patternsShort/decimalFormat". -
populate
Java-only method used by CLDR tooling. -
getMultiplier
public int getMultiplier(int magnitude) Description copied from interface:MultiplierProducer
Maps a magnitude to a multiplier in powers of ten. For example, in compact notation in English, a magnitude of 5 (e.g., 100,000) should return a multiplier of -3, since the number is displayed in thousands.- Specified by:
getMultiplier
in interfaceMultiplierProducer
- Parameters:
magnitude
- The power of ten of the input number.- Returns:
- The shift in powers of ten.
-
getPattern
-
getUniquePatterns
-
getIndex
-
countZeros
-