public final class DecimalStyle extends Object
A significant part of dealing with dates and times is the localization. This class acts as a central point for accessing the information.
| Modifier and Type | Field and Description |
|---|---|
static DecimalStyle |
STANDARD
The standard set of non-localized decimal style symbols.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object
Checks if this DecimalStyle is equal another DecimalStyle.
|
static Set |
getAvailableLocales()
Lists all the locales that are supported.
|
char |
getDecimalSeparator()
Gets the character that represents the decimal point.
|
char |
getNegativeSign()
Gets the character that represents the negative sign.
|
char |
getPositiveSign()
Gets the character that represents the positive sign.
|
char |
getZeroDigit()
Gets the character that represents zero.
|
int |
hashCode()
A hash code for this DecimalStyle.
|
static DecimalStyle |
of(Locale
Obtains the DecimalStyle for the specified locale.
|
static DecimalStyle |
ofDefaultLocale()
Obtains the DecimalStyle for the default
FORMAT locale.
|
String |
toString()
Returns a string describing this DecimalStyle.
|
DecimalStyle |
withDecimalSeparator(char decimalSeparator)
Returns a copy of the info with a new character that represents the decimal point.
|
DecimalStyle |
withNegativeSign(char negativeSign)
Returns a copy of the info with a new character that represents the negative sign.
|
DecimalStyle |
withPositiveSign(char positiveSign)
Returns a copy of the info with a new character that represents the positive sign.
|
DecimalStyle |
withZeroDigit(char zeroDigit)
Returns a copy of the info with a new character that represents zero.
|
public static final DecimalStyleSTANDARD
This uses standard ASCII characters for zero, positive, negative and a dot for the decimal point.
public static Set<Locale > getAvailableLocales()
The locale 'en_US' will always be present.
public static DecimalStyleofDefaultLocale()
FORMAT locale.
This method provides access to locale sensitive decimal style symbols.
This is equivalent to calling of(Locale.getDefault(Locale.Category.FORMAT)).
Locale.Category.FORMAT
public static DecimalStyleof(Locale locale)
This method provides access to locale sensitive decimal style symbols.
locale - the locale, not null
public char getZeroDigit()
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.
public DecimalStylewithZeroDigit(char zeroDigit)
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.
zeroDigit - the character for zero
public char getPositiveSign()
The character used to represent a positive number may vary by culture. This method specifies the character to use.
public DecimalStylewithPositiveSign(char positiveSign)
The character used to represent a positive number may vary by culture. This method specifies the character to use.
positiveSign - the character for the positive sign
public char getNegativeSign()
The character used to represent a negative number may vary by culture. This method specifies the character to use.
public DecimalStylewithNegativeSign(char negativeSign)
The character used to represent a negative number may vary by culture. This method specifies the character to use.
negativeSign - the character for the negative sign
public char getDecimalSeparator()
The character used to represent a decimal point may vary by culture. This method specifies the character to use.
public DecimalStylewithDecimalSeparator(char decimalSeparator)
The character used to represent a decimal point may vary by culture. This method specifies the character to use.
decimalSeparator - the character for the decimal point
public boolean equals(Objectobj)
equals in class
Object
obj - the object to check, null returns false
Object.hashCode() ,
HashMap
public int hashCode()
hashCode in class
Object
Object.equals(java.lang.Object) ,
System.identityHashCode(java.lang.Object)