A significant part of dealing with dates and times is the localization. This class acts as a central point for accessing the information.
- Implementation Requirements:
- This class is immutable and thread-safe.
- Since:
- 1.8
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final DecimalStyleThe standard set of non-localized decimal style symbols.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanChecks if this DecimalStyle is equal to another DecimalStyle.Lists all the locales that are supported.charGets the character that represents the decimal point.charGets the character that represents the negative sign.charGets the character that represents the positive sign.charGets the character that represents zero.inthashCode()A hash code for this DecimalStyle.static DecimalStyleObtains the DecimalStyle for the specified locale.static DecimalStyleObtains the DecimalStyle for the defaultFORMATlocale.toString()Returns a string describing this DecimalStyle.withDecimalSeparator(char decimalSeparator) Returns a copy of the info with a new character that represents the decimal point.withNegativeSign(char negativeSign) Returns a copy of the info with a new character that represents the negative sign.withPositiveSign(char positiveSign) Returns a copy of the info with a new character that represents the positive sign.withZeroDigit(char zeroDigit) Returns a copy of the info with a new character that represents zero.
- 
Field Details- 
STANDARDThe standard set of non-localized decimal style symbols.This uses standard ASCII characters for zero, positive, negative and a dot for the decimal point. 
 
- 
- 
Method Details- 
getAvailableLocalesLists all the locales that are supported.The locale 'en_US' will always be present. - Returns:
- a Set of Locales for which localization is supported
 
- 
ofDefaultLocaleObtains the DecimalStyle for the defaultFORMATlocale.This method provides access to locale sensitive decimal style symbols. This is equivalent to calling of(Locale.getDefault(Locale.Category.FORMAT)).- Returns:
- the decimal style, not null
- See Also:
 
- 
ofObtains 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. - Parameters:
- locale- the locale, not null
- Returns:
- the decimal style, not null
 
- 
getZeroDigitpublic 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. - Returns:
- the character for zero
 
- 
withZeroDigitReturns 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. - Parameters:
- zeroDigit- the character for zero
- Returns:
- a copy with a new character that represents zero, not null
 
- 
getPositiveSignpublic 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. - Returns:
- the character for the positive sign
 
- 
withPositiveSignReturns 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. - Parameters:
- positiveSign- the character for the positive sign
- Returns:
- a copy with a new character that represents the positive sign, not null
 
- 
getNegativeSignpublic 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. - Returns:
- the character for the negative sign
 
- 
withNegativeSignReturns 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. - Parameters:
- negativeSign- the character for the negative sign
- Returns:
- a copy with a new character that represents the negative sign, not null
 
- 
getDecimalSeparatorpublic 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. - Returns:
- the character for the decimal point
 
- 
withDecimalSeparatorReturns 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. - Parameters:
- decimalSeparator- the character for the decimal point
- Returns:
- a copy with a new character that represents the decimal point, not null
 
- 
equalsChecks if this DecimalStyle is equal to another DecimalStyle.
- 
hashCodepublic int hashCode()A hash code for this DecimalStyle.
- 
toStringReturns a string describing this DecimalStyle.
 
-