java.lang.Object | |
↳ | java.text.DecimalFormatSymbols |
Encapsulates the set of symbols (such as the decimal separator, the grouping
separator, and so on) needed by DecimalFormat
to format numbers.
DecimalFormat
internally creates an instance of
DecimalFormatSymbols
from its locale data. If you need to change any
of these symbols, you can get the DecimalFormatSymbols
object from
your DecimalFormat
and modify it.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
DecimalFormatSymbols containing the symbols for
the user's default locale.
| |||||||||||
Constructs a new DecimalFormatSymbols containing the symbols for the
specified Locale.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates and returns a copy of this
Object .
| |||||||||||
Compares the specified object to this
DecimalFormatSymbols and
indicates if they are equal.
| |||||||||||
Returns an array of locales for which custom
DecimalFormatSymbols instances
are available.
| |||||||||||
Returns the currency.
| |||||||||||
Returns the currency symbol.
| |||||||||||
Returns the character which represents the decimal point in a number.
| |||||||||||
Returns the character which represents a single digit in a format
pattern.
| |||||||||||
Returns the character used as the thousands separator in a number.
| |||||||||||
Returns the string which represents infinity.
| |||||||||||
Returns a new
DecimalFormatSymbols for the given locale.
| |||||||||||
Returns a new
DecimalFormatSymbols instance for the user's default locale.
| |||||||||||
Returns the international currency symbol.
| |||||||||||
Returns the minus sign character.
| |||||||||||
Returns the character which represents the decimal point in a monetary
value.
| |||||||||||
Returns the string which represents NaN.
| |||||||||||
Returns the character which separates the positive and negative patterns
in a format pattern.
| |||||||||||
Returns the per mill sign character.
| |||||||||||
Returns the percent character.
| |||||||||||
Returns the character which represents zero.
| |||||||||||
Returns an integer hash code for this object.
| |||||||||||
Sets the currency.
| |||||||||||
Sets the currency symbol.
| |||||||||||
Sets the character which represents the decimal point in a number.
| |||||||||||
Sets the character which represents a single digit in a format pattern.
| |||||||||||
Sets the string used to separate mantissa and exponent.
| |||||||||||
Sets the character used as the thousands separator in a number.
| |||||||||||
Sets the string which represents infinity.
| |||||||||||
Sets the international currency symbol.
| |||||||||||
Sets the minus sign character.
| |||||||||||
Sets the character which represents the decimal point in a monetary
value.
| |||||||||||
Sets the string which represents NaN.
| |||||||||||
Sets the character which separates the positive and negative patterns in
a format pattern.
| |||||||||||
Sets the per mill sign character.
| |||||||||||
Sets the percent character.
| |||||||||||
Sets the character which represents zero.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Constructs a new DecimalFormatSymbols
containing the symbols for
the user's default locale.
See "Be wary of the default locale".
Best practice is to create a DecimalFormat
and then to get the DecimalFormatSymbols
from that object by
calling getDecimalFormatSymbols()
.
Constructs a new DecimalFormatSymbols containing the symbols for the
specified Locale.
See "Be wary of the default locale".
Best practice is to create a DecimalFormat
and then to get the DecimalFormatSymbols
from that object by
calling getDecimalFormatSymbols()
.
locale | the locale. |
---|
Creates and returns a copy of this Object
. The default
implementation returns a so-called "shallow" copy: It creates a new
instance of the same class and then copies the field values (including
object references) from this instance to the new instance. A "deep" copy,
in contrast, would also recursively clone nested objects. A subclass that
needs to implement this kind of cloning should call super.clone()
to create the new instance and then create deep copies of the nested,
mutable objects.
Compares the specified object to this DecimalFormatSymbols
and
indicates if they are equal. In order to be equal, object
must be
an instance of DecimalFormatSymbols
and contain the same symbols.
object | the object to compare with this object. |
---|
true
if the specified object is equal to this
DecimalFormatSymbols
; false
otherwise.Returns an array of locales for which custom DecimalFormatSymbols
instances
are available.
Note that Android does not support user-supplied locale service providers.
Returns the currency.
null
is returned if setInternationalCurrencySymbol()
has
been previously called with a value that is not a valid ISO 4217 currency
code.
setCurrency()
or setInternationalCurrencySymbol()
,
or null
if an invalid currency was set.Returns the currency symbol.
Returns the character which represents the decimal point in a number.
Returns the character which represents a single digit in a format pattern.
Returns the character used as the thousands separator in a number.
Returns the string which represents infinity.
Returns a new DecimalFormatSymbols
for the given locale.
locale | the locale |
---|
DecimalFormatSymbols
NullPointerException | if locale == null |
---|
Returns a new DecimalFormatSymbols
instance for the user's default locale.
See "Be wary of the default locale".
DecimalFormatSymbols
Returns the international currency symbol.
Returns the minus sign character.
Returns the character which represents the decimal point in a monetary value.
Returns the string which represents NaN.
Returns the character which separates the positive and negative patterns in a format pattern.
Returns the per mill sign character.
Returns the percent character.
Returns the character which represents zero.
Returns an integer hash code for this object. By contract, any two
objects for which equals(Object)
returns true
must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode
method
if you intend implementing your own hashCode
method.
Sets the currency.
The international currency symbol and the currency symbol are updated, but the min and max number of fraction digits stays the same.
currency | the new currency. |
---|
NullPointerException | if currency is null .
|
---|
Sets the currency symbol.
value | the currency symbol. |
---|
Sets the character which represents the decimal point in a number.
value | the decimal separator character. |
---|
Sets the character which represents a single digit in a format pattern.
value | the digit character. |
---|
Sets the string used to separate mantissa and exponent. Typically "E", as in "1.2E3".
Sets the character used as the thousands separator in a number.
value | the grouping separator character. |
---|
Sets the string which represents infinity.
value | the string representing infinity. |
---|
Sets the international currency symbol.
The currency and currency symbol are also updated if value
is a
valid ISO4217 currency code.
The min and max number of fraction digits stay the same.
value | the currency code. |
---|
Sets the minus sign character.
value | the minus sign character. |
---|
Sets the character which represents the decimal point in a monetary value.
value | the monetary decimal separator character. |
---|
Sets the string which represents NaN.
value | the string representing NaN. |
---|
Sets the character which separates the positive and negative patterns in a format pattern.
value | the pattern separator character. |
---|
Sets the per mill sign character.
value | the per mill character. |
---|
Sets the percent character.
value | the percent character. |
---|
Sets the character which represents zero.
value | the zero digit character. |
---|
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.