A significant part of dealing with dates and times is the localization. This class acts as a central point for accessing the information.
Implementation Specification
This class is immutable and thread-safe.
| Modifier and Type | Field and Description |
|---|---|
| private static final ConcurrentMap | CACHE
The cache of DecimalStyle instances. |
| private final char | decimalSeparator
The decimal separator. |
| private final char | negativeSign
The negative sign. |
| private final char | positiveSign
The positive sign. |
| public static final DecimalStyle | STANDARD
The standard set of non-localized decimal style symbols. |
| private final char | zeroDigit
The zero digit. |
| Access | Constructor and Description |
|---|---|
| private | DecimalStyle(char
the character to use for the digit of zero zeroChar, char the character to use for the positive sign positiveSignChar, char the character to use for the negative sign negativeSignChar, char the character to use for the decimal point decimalPointChar)Restricted constructor. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv String | Returns: the internationalized text, not nullthe text, consisting of digits 0 to 9, to convert, not null numericText)Converts the input numeric text to the internationalized form using the zero character. |
| pack-priv int | Returns: the value, 0 to 9, of the character, or -1 if not a digitthe character to check ch)Checks whether the character is a digit, based on the currently set zero character. |
| private static DecimalStyle | |
| public boolean | Returns: true if this is equal to the other datethe object to check, null returns false obj)Overrides java. Checks if this DecimalStyle is equal to another DecimalStyle. |
| public static Set | Returns: a Set of Locales for which localization is supportedLists all the locales that are supported. |
| public char | Returns: the character for the decimal pointGets the character that represents the decimal point. |
| public char | Returns: the character for the negative signGets the character that represents the negative sign. |
| public char | Returns: the character for the positive signGets the character that represents the positive sign. |
| public char | |
| public int | Returns: a suitable hash codeOverrides java. A hash code for this DecimalStyle. |
| public static DecimalStyle | |
| public static DecimalStyle | Returns: the decimal style, not nullObtains the DecimalStyle for the default
|
| public String | Returns: a string description, not nullOverrides java. Returns a string describing this DecimalStyle. |
| public DecimalStyle | Returns: a copy with a new character that represents the decimal point, not nullthe character for the decimal point decimalSeparator)Returns a copy of the info with a new character that represents the decimal point. |
| public DecimalStyle | Returns: a copy with a new character that represents the negative sign, not nullthe character for the negative sign negativeSign)Returns a copy of the info with a new character that represents the negative sign. |
| public DecimalStyle | Returns: a copy with a new character that represents the positive sign, not nullthe character for the positive sign positiveSign)Returns a copy of the info with a new character that represents the positive sign. |
| public DecimalStyle | Returns: a copy with a new character that represents zero, not nullthe character for zero zeroDigit)Returns a copy of the info with a new character that represents zero. |
| CACHE | back to summary |
|---|---|
| private static final ConcurrentMap<Locale, DecimalStyle> CACHE The cache of DecimalStyle instances. | |
| decimalSeparator | back to summary |
|---|---|
| private final char decimalSeparator The decimal separator. | |
| negativeSign | back to summary |
|---|---|
| private final char negativeSign The negative sign. | |
| positiveSign | back to summary |
|---|---|
| private final char positiveSign The positive sign. | |
| STANDARD | back to summary |
|---|---|
| public static final DecimalStyle STANDARD The standard set of non-localized decimal style symbols. This uses standard ASCII characters for zero, positive, negative and a dot for the decimal point. | |
| zeroDigit | back to summary |
|---|---|
| private final char zeroDigit The zero digit. | |
| DecimalStyle | back to summary |
|---|---|
| private DecimalStyle(char zeroChar, char positiveSignChar, char negativeSignChar, char decimalPointChar) Restricted constructor.
| |
| convertNumberToI18N | back to summary |
|---|---|
| pack-priv String convertNumberToI18N(String numericText) Converts the input numeric text to the internationalized form using the zero character. | |
| convertToDigit | back to summary |
|---|---|
| pack-priv int convertToDigit(char ch) Checks whether the character is a digit, based on the currently set zero character.
| |
| create | back to summary |
|---|---|
| private static DecimalStyle create(Locale locale) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Checks if this DecimalStyle is equal to another DecimalStyle. | |
| getAvailableLocales | back to summary |
|---|---|
| public static Set Lists all the locales that are supported.
At a minimum, the returned | |
| getDecimalSeparator | back to summary |
|---|---|
| public char getDecimalSeparator() Gets the character that represents the decimal point. The character used to represent a decimal point may vary by culture. This method specifies the character to use.
| |
| getNegativeSign | back to summary |
|---|---|
| public char getNegativeSign() Gets the character that represents the negative sign. The character used to represent a negative number may vary by culture. This method specifies the character to use.
| |
| getPositiveSign | back to summary |
|---|---|
| public char getPositiveSign() Gets the character that represents the positive sign. The character used to represent a positive number may vary by culture. This method specifies the character to use.
| |
| getZeroDigit | back to summary |
|---|---|
| public char getZeroDigit() Gets the character that represents zero. The character used to represent digits may vary by culture. This method specifies the zero character to use, which implies the characters for one to nine.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. A hash code for this DecimalStyle.
| |
| of | back to summary |
|---|---|
| public static DecimalStyle of(Locale locale) Obtains the DecimalStyle for the specified locale. This method provides access to locale sensitive decimal style symbols. If the locale contains "nu" (Numbering System) and/or "rg" (Region Override) Unicode extensions, returned instance will reflect the values specified with those extensions. If both "nu" and "rg" are specified, the value from the "nu" extension supersedes the implicit one from the "rg" extension.
| |
| ofDefaultLocale | back to summary |
|---|---|
| public static DecimalStyle ofDefaultLocale() Obtains the DecimalStyle for the default
This method provides access to locale sensitive decimal style symbols.
This is equivalent to calling
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string describing this DecimalStyle. | |
| withDecimalSeparator | back to summary |
|---|---|
| public DecimalStyle withDecimalSeparator(char decimalSeparator) Returns a copy of the info with a new character that represents the decimal point. The character used to represent a decimal point may vary by culture. This method specifies the character to use.
| |
| withNegativeSign | back to summary |
|---|---|
| public DecimalStyle withNegativeSign(char negativeSign) Returns a copy of the info with a new character that represents the negative sign. The character used to represent a negative number may vary by culture. This method specifies the character to use.
| |
| withPositiveSign | back to summary |
|---|---|
| public DecimalStyle withPositiveSign(char positiveSign) Returns a copy of the info with a new character that represents the positive sign. The character used to represent a positive number may vary by culture. This method specifies the character to use.
| |
| withZeroDigit | back to summary |
|---|---|
| public DecimalStyle withZeroDigit(char zeroDigit) Returns a copy of the info with a new character that represents zero. The character used to represent digits may vary by culture. This method specifies the zero character to use, which implies the characters for one to nine.
| |