java.text
Class DecimalFormatSymbols
- Cloneable, Serializable
This class is a container for the symbols used by
DecimalFormat
to format numbers and currency
for a particular locale. These are
normally handled automatically, but an application can override
values as desired using this class.
DecimalFormatSymbols() - This method initializes a new instance of
DecimalFormatSymbols for the default locale.
|
DecimalFormatSymbols(Locale loc) - This method initializes a new instance of
DecimalFormatSymbols for the specified locale.
|
Object | clone()
|
boolean | equals(Object obj) - This method this this object for equality against the specified object.
|
Currency | getCurrency() - Returns the currency corresponding to the currency symbol stored
in this instance of
DecimalFormatSymbols .
|
String | getCurrencySymbol() - This method returns the currency symbol in local format.
|
char | getDecimalSeparator() - This method returns the character used as the decimal point.
|
char | getDigit() - This method returns the character used to represent a digit in a
format pattern string.
|
char | getGroupingSeparator() - This method sets the character used to separate groups of digits.
|
String | getInfinity() - This method returns the character used to represent infinity.
|
static DecimalFormatSymbols | getInstance() - Returns a
DecimalFormatSymbols instance for the
default locale obtained from either the runtime itself
or one of the installed
DecimalFormatSymbolsProvider instances.
|
static DecimalFormatSymbols | getInstance(Locale locale) - Returns a
DecimalFormatSymbols instance for the
specified locale obtained from either the runtime itself
or one of the installed
DecimalFormatSymbolsProvider instances.
|
String | getInternationalCurrencySymbol() - This method returns the ISO 4217 currency code for
the currency used.
|
char | getMinusSign() - This method returns the character used to represent the minus sign.
|
char | getMonetaryDecimalSeparator() - This method returns the character used to represent the decimal
point for currency values.
|
String | getNaN() - This method returns the string used to represent the NaN (not a number)
value.
|
char | getPatternSeparator() - This method returns the character used to separate positive and negative
subpatterns in a format pattern.
|
char | getPerMill() - This method returns the character used as the per mille character.
|
char | getPercent() - This method returns the character used as the percent sign.
|
char | getZeroDigit() - This method returns the character used to represent the digit zero.
|
int | hashCode() - This method returns a hash value for this object.
|
void | setCurrency(Currency currency) - This method sets the currency symbol and ISO 4217 currency
code to the values obtained from the supplied currency.
|
void | setCurrencySymbol(String currency) - This method sets the currency symbol to the specified value.
|
void | setDecimalSeparator(char decimalSep) - This method sets the decimal point character to the specified value.
|
void | setDigit(char digit) - This method sets the character used to represents a digit in a format
string to the specified value.
|
void | setGroupingSeparator(char groupSep) - This method sets the character used to separate groups of digits.
|
void | setInfinity(String infinity) - This method sets the string used to represents infinity.
|
void | setInternationalCurrencySymbol(String currencyCode) - This method sets the international currency symbol to the
specified value.
|
void | setMinusSign(char minusSign) - This method sets the character used to represent the minus sign.
|
void | setMonetaryDecimalSeparator(char decimalSep) - This method sets the character used for the decimal point in currency
values.
|
void | setNaN(String nan) - This method sets the string used to represent the NaN (not a
number) value.
|
void | setPatternSeparator(char patternSep) - This method sets the character used to separate positive and negative
subpatterns in a format pattern.
|
void | setPerMill(char perMill) - This method sets the character used as the per mille character.
|
void | setPercent(char percent) - This method sets the character used as the percent sign.
|
void | setZeroDigit(char zeroDigit) - This method sets the character used to represent the digit zero.
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
DecimalFormatSymbols
public DecimalFormatSymbols(Locale loc)
This method initializes a new instance of
DecimalFormatSymbols
for the specified locale.
Note: if the locale does not have an associated
Currency
instance, the currency symbol and
international currency symbol will be set to the strings "?"
and "XXX" respectively. This generally happens with language
locales (those with no specified country), such as
Locale.ENGLISH
. This constructor only obtains
instances using the runtime's resources; to also include
DecimalFormatSymbolsProvider
instances,
call
getInstance(Locale)
instead.
loc
- The local to load symbols for.
equals
public boolean equals(Object obj)
This method this this object for equality against the specified object.
This will be true if and only if the following criteria are met with
regard to the specified object:
- It is not
null
. - It is an instance of
DecimalFormatSymbols
. - All of its symbols are identical to the symbols in this object.
- equals in interface Object
true
if the specified object is equal to this
object, false
otherwise.
getCurrency
public Currency getCurrency()
Returns the currency corresponding to the currency symbol stored
in this instance of DecimalFormatSymbols
.
- An instance of
Currency
which matches
the currency used, or null if there is no corresponding
instance.
getCurrencySymbol
public String getCurrencySymbol()
This method returns the currency symbol in local format. For example,
"$" for Canadian dollars.
- The currency symbol in local format.
getDecimalSeparator
public char getDecimalSeparator()
This method returns the character used as the decimal point.
- The character used as the decimal point.
getDigit
public char getDigit()
This method returns the character used to represent a digit in a
format pattern string.
- The character used to represent a digit in a format
pattern string.
getGroupingSeparator
public char getGroupingSeparator()
This method sets the character used to separate groups of digits. For
example, the United States uses a comma (,) to separate thousands in
a number.
- The character used to separate groups of digits.
getInfinity
public String getInfinity()
This method returns the character used to represent infinity.
- The character used to represent infinity.
getMinusSign
public char getMinusSign()
This method returns the character used to represent the minus sign.
- The character used to represent the minus sign.
getMonetaryDecimalSeparator
public char getMonetaryDecimalSeparator()
This method returns the character used to represent the decimal
point for currency values.
- The decimal point character used in currency values.
getNaN
public String getNaN()
This method returns the string used to represent the NaN (not a number)
value.
- The string used to represent NaN
getPatternSeparator
public char getPatternSeparator()
This method returns the character used to separate positive and negative
subpatterns in a format pattern.
- The character used to separate positive and negative subpatterns
in a format pattern.
getPerMill
public char getPerMill()
This method returns the character used as the per mille character.
getPercent
public char getPercent()
This method returns the character used as the percent sign.
- The character used as the percent sign.
getZeroDigit
public char getZeroDigit()
This method returns the character used to represent the digit zero.
- The character used to represent the digit zero.
hashCode
public int hashCode()
This method returns a hash value for this object.
- hashCode in interface Object
- A hash value for this object.
setCurrency
public void setCurrency(Currency currency)
This method sets the currency symbol and ISO 4217 currency
code to the values obtained from the supplied currency.
currency
- the currency from which to obtain the values.
setCurrencySymbol
public void setCurrencySymbol(String currency)
This method sets the currency symbol to the specified value.
currency
- The new currency symbol
setDecimalSeparator
public void setDecimalSeparator(char decimalSep)
This method sets the decimal point character to the specified value.
decimalSep
- The new decimal point character
setDigit
public void setDigit(char digit)
This method sets the character used to represents a digit in a format
string to the specified value.
digit
- The character used to represent a digit in a format pattern.
setGroupingSeparator
public void setGroupingSeparator(char groupSep)
This method sets the character used to separate groups of digits.
groupSep
- The character used to separate groups of digits.
setInfinity
public void setInfinity(String infinity)
This method sets the string used to represents infinity.
infinity
- The string used to represent infinity.
setInternationalCurrencySymbol
public void setInternationalCurrencySymbol(String currencyCode)
This method sets the international currency symbol to the
specified value. If a valid Currency
instance
exists for the international currency code, then this is
used for the currency attribute, and the currency symbol
is set to the corresponding value from this instance.
Otherwise, the currency attribute is set to null and the
symbol is left unmodified.
currencyCode
- The new international currency symbol.
setMinusSign
public void setMinusSign(char minusSign)
This method sets the character used to represent the minus sign.
minusSign
- The character used to represent the minus sign.
setMonetaryDecimalSeparator
public void setMonetaryDecimalSeparator(char decimalSep)
This method sets the character used for the decimal point in currency
values.
decimalSep
- The decimal point character used in currency values.
setNaN
public void setNaN(String nan)
This method sets the string used to represent the NaN (not a
number) value.
nan
- The string used to represent NaN
setPatternSeparator
public void setPatternSeparator(char patternSep)
This method sets the character used to separate positive and negative
subpatterns in a format pattern.
patternSep
- The character used to separate positive and
negative subpatterns in a format pattern.
setPerMill
public void setPerMill(char perMill)
This method sets the character used as the per mille character.
perMill
- The per mille character.
setPercent
public void setPercent(char percent)
This method sets the character used as the percent sign.
percent
- The character used as the percent sign.
setZeroDigit
public void setZeroDigit(char zeroDigit)
This method sets the character used to represent the digit zero.
zeroDigit
- The character used to represent the digit zero.
DecimalFormatSymbols.java -- Format symbols used by DecimalFormat
Copyright (C) 1999, 2000, 2001, 2004, 2007 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.