public class PatternStringUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PatternStringUtils.PatternSignType |
| Constructor and Description |
|---|
PatternStringUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertLocalized(String input,
DecimalFormatSymbols symbols,
boolean toLocalized)
Converts a pattern between standard notation and localized notation.
|
static boolean |
ignoreRoundingIncrement(BigDecimal roundIncrDec,
int maxFrac)
Determine whether a given roundingIncrement should be ignored for formatting
based on the current maxFrac value (maximum fraction digits).
|
static void |
patternInfoToStringBuilder(AffixPatternProvider patternInfo,
boolean isPrefix,
PatternStringUtils.PatternSignType patternSignType,
boolean approximately,
StandardPlural plural,
boolean perMilleReplacesPercent,
StringBuilder output)
This method contains the heart of the logic for rendering LDML affix strings.
|
static String |
propertiesToPatternString(DecimalFormatProperties properties)
Creates a pattern string from a property bag.
|
static PatternStringUtils.PatternSignType |
resolveSignDisplay(NumberFormatter.SignDisplay signDisplay,
Modifier.Signum signum) |
public static boolean ignoreRoundingIncrement(BigDecimal roundIncrDec, int maxFrac)
roundIncrDec - The roundingIncrement to be checked. Must be non-null.maxFrac - The current maximum fraction digits value.public static String propertiesToPatternString(DecimalFormatProperties properties)
Since pattern strings support only a subset of the functionality available in a property bag, a new property bag created from the string returned by this function may not be the same as the original property bag.
properties - The property bag to serialize.public static String convertLocalized(String input, DecimalFormatSymbols symbols, boolean toLocalized)
A greedy string-substitution strategy is used to substitute locale symbols. If two symbols are ambiguous or have the same prefix, the result is not well-defined.
Locale symbols are not allowed to contain the ASCII quote character.
This method is provided for backwards compatibility and should not be used in any new code.
input - The pattern to convert.symbols - The symbols corresponding to the localized pattern.toLocalized - true to convert from standard to localized notation; false to convert from localized to
standard notation.public static void patternInfoToStringBuilder(AffixPatternProvider patternInfo, boolean isPrefix, PatternStringUtils.PatternSignType patternSignType, boolean approximately, StandardPlural plural, boolean perMilleReplacesPercent, StringBuilder output)
public static PatternStringUtils.PatternSignType resolveSignDisplay(NumberFormatter.SignDisplay signDisplay, Modifier.Signum signum)