This class, as well as NumberPropertyMapper, could go into the impl package, but they depend on too many package-private members of the public APIs.
| Modifier and Type | Field and Description |
|---|---|
| private static final Currency | |
| pack-priv final MicroPropsGenerator | |
| pack-priv final MicroProps |
| Access | Constructor and Description |
|---|---|
| public | NumberFormatterImpl(MacroProps macros)
Builds a "safe" MicroPropsGenerator, which is thread-safe and can be used repeatedly. |
| Modifier and Type | Method and Description |
|---|---|
| public MicroProps | format(DecimalQuantity inValue, FormattedStringBuilder outString)
Deprecated
as a consequence of
Evaluates the "safe" MicroPropsGenerator created by "fromMacros".
DecimalQuantity being deprecated.
|
| public static MicroProps | formatStatic(MacroProps macros, DecimalQuantity inValue, FormattedStringBuilder outString)
Deprecated
as a consequence of
Builds and evaluates an "unsafe" MicroPropsGenerator, which is cheaper but can be used only once.
DecimalQuantity being deprecated.
|
| public int | |
| private static int | |
| public static int | Returns: The index into the output at which the prefix ends and the suffix starts; in other words, the prefix length.Prints only the prefix and suffix; used for DecimalFormat getters. |
| public MicroProps | |
| private static MicroPropsGenerator | macrosToMicroGenerator(MacroProps
The macros, MicroProps micros, boolean MacroProps to consume. This method does not mutate the MacroProps instance.If true, the returned MicroPropsGenerator will be thread-safe. If false, the returned
value will not be thread-safe, intended for a single "one-shot" use only.
Building the thread-safe object is more expensive. safe)Synthesizes the MacroProps into a MicroPropsGenerator. |
| public MicroProps | preProcess(DecimalQuantity inValue)
Deprecated
as a consequence of
Like format(), but saves the result into an output MicroProps without additional processing.
DecimalQuantity being deprecated.
|
| private static MicroProps | preProcessUnsafe(MacroProps macros, DecimalQuantity inValue)
Deprecated
as a consequence of
DecimalQuantity being deprecated.
|
| private static boolean | |
| private static boolean | |
| private static boolean | |
| private static boolean | |
| public static int | |
| private static int | writeFractionDigits(MicroProps micros, DecimalQuantity quantity, FormattedStringBuilder string, int index)
Deprecated
as a consequence of
DecimalQuantity being deprecated.
|
| private static int | writeIntegerDigits(MicroProps micros, DecimalQuantity quantity, FormattedStringBuilder string, int index)
Deprecated
as a consequence of
DecimalQuantity being deprecated.
|
| public static int | writeNumber(MicroProps micros, DecimalQuantity quantity, FormattedStringBuilder string, int index)
Deprecated
as a consequence of
Synthesizes the output string from a MicroProps and DecimalQuantity.
DecimalQuantity being deprecated.
|
| DEFAULT_CURRENCY | back to summary |
|---|---|
| private static final Currency DEFAULT_CURRENCY | |
| microPropsGenerator | back to summary |
|---|---|
| pack-priv final MicroPropsGenerator microPropsGenerator | |
| micros | back to summary |
|---|---|
| pack-priv final MicroProps micros | |
| NumberFormatterImpl | back to summary |
|---|---|
| public NumberFormatterImpl(MacroProps macros) Builds a "safe" MicroPropsGenerator, which is thread-safe and can be used repeatedly. | |
| format | back to summary |
|---|---|
| public MicroProps format(DecimalQuantity inValue, FormattedStringBuilder outString)
Deprecated as a consequence of Evaluates the "safe" MicroPropsGenerator created by "fromMacros". | |
| formatStatic | back to summary |
|---|---|
| public static MicroProps formatStatic(MacroProps macros, DecimalQuantity inValue, FormattedStringBuilder outString)
Deprecated as a consequence of Builds and evaluates an "unsafe" MicroPropsGenerator, which is cheaper but can be used only once. | |
| getPrefixSuffix | back to summary |
|---|---|
| public int getPrefixSuffix(byte signum, StandardPlural plural, FormattedStringBuilder output) | |
| getPrefixSuffixImpl | back to summary |
|---|---|
| private static int getPrefixSuffixImpl(MicroPropsGenerator generator, byte signum, FormattedStringBuilder output) | |
| getPrefixSuffixStatic | back to summary |
|---|---|
| public static int getPrefixSuffixStatic(MacroProps macros, byte signum, StandardPlural plural, FormattedStringBuilder output) Prints only the prefix and suffix; used for DecimalFormat getters.
| |
| getRawMicroProps | back to summary |
|---|---|
| public MicroProps getRawMicroProps() | |
| macrosToMicroGenerator | back to summary |
|---|---|
| private static MicroPropsGenerator macrosToMicroGenerator(MacroProps macros, MicroProps micros, boolean safe) Synthesizes the MacroProps into a MicroPropsGenerator. All information, including the locale, is encoded into the MicroPropsGenerator, except for the quantity itself, which is left abstract and must be provided to the returned MicroPropsGenerator instance.
| |
| preProcess | back to summary |
|---|---|
| public MicroProps preProcess(DecimalQuantity inValue)
Deprecated as a consequence of Like format(), but saves the result into an output MicroProps without additional processing. | |
| preProcessUnsafe | back to summary |
|---|---|
| private static MicroProps preProcessUnsafe(MacroProps macros, DecimalQuantity inValue)
Deprecated as a consequence of | |
| unitIsBaseUnit | back to summary |
|---|---|
| private static boolean unitIsBaseUnit(MeasureUnit unit) | |
| unitIsCurrency | back to summary |
|---|---|
| private static boolean unitIsCurrency(MeasureUnit unit) | |
| unitIsPercent | back to summary |
|---|---|
| private static boolean unitIsPercent(MeasureUnit unit) | |
| unitIsPermille | back to summary |
|---|---|
| private static boolean unitIsPermille(MeasureUnit unit) | |
| writeAffixes | back to summary |
|---|---|
| public static int writeAffixes(MicroProps micros, FormattedStringBuilder string, int start, int end) Adds the affixes. Intended to be called immediately after formatNumber. | |
| writeFractionDigits | back to summary |
|---|---|
| private static int writeFractionDigits(MicroProps micros, DecimalQuantity quantity, FormattedStringBuilder string, int index)
Deprecated as a consequence of | |
| writeIntegerDigits | back to summary |
|---|---|
| private static int writeIntegerDigits(MicroProps micros, DecimalQuantity quantity, FormattedStringBuilder string, int index)
Deprecated as a consequence of | |
| writeNumber | back to summary |
|---|---|
| public static int writeNumber(MicroProps micros, DecimalQuantity quantity, FormattedStringBuilder string, int index)
Deprecated as a consequence of Synthesizes the output string from a MicroProps and DecimalQuantity. This method formats only the main number, not affixes. | |