| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
DecimalFormat decimalformat = …;
DecimalFormatSymbols decimalformatsymbols = decimalformat.getDecimalFormatSymbols();
Based on 41 examples
public class DecimalFormatSymbols extends Object implements Cloneable, Serializable
This class represents the set of symbols (such as the decimal separator,
the grouping separator, and so on) needed by DecimalFormat
to format numbers. DecimalFormat
creates for itself 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.
Constructor Summary | |
---|---|
Create a DecimalFormatSymbols object for the default locale. |
|
DecimalFormatSymbols(Locale locale) Create a DecimalFormatSymbols object for the given locale. |
Method Summary | |
---|---|
Object |
clone() Standard override. |
boolean |
Override equals. |
static Locale[] |
Returns an array of all locales for which the getInstance methods of this class can return
localized instances.
|
Currency |
Gets the currency of these DecimalFormatSymbols. |
String |
Returns the currency symbol for the currency of these DecimalFormatSymbols in their locale. |
char |
Gets the character used for decimal sign. |
char |
getDigit() Gets the character used for a digit in a pattern. |
String |
Returns the string used to separate the mantissa from the exponent. |
char |
Gets the character used for thousands separator. |
String |
Gets the string used to represent infinity. |
static DecimalFormatSymbols |
Gets the DecimalFormatSymbols instance for the default
locale.
|
static DecimalFormatSymbols |
getInstance(Locale locale) Gets the DecimalFormatSymbols instance for the specified
locale.
|
String |
Returns the ISO 4217 currency code of the currency of these DecimalFormatSymbols. |
char |
Gets the character used to represent minus sign. |
char |
Returns the monetary decimal separator. |
String |
getNaN() Gets the string used to represent "not a number". |
char |
Gets the character used to separate positive and negative subpatterns in a pattern. |
char |
Gets the character used for percent sign. |
char |
Gets the character used for per mille sign. |
char |
Gets the character used for zero. |
int |
hashCode() Override hashCode. |
void |
setCurrency(Currency currency) Sets the currency of these DecimalFormatSymbols. |
void |
setCurrencySymbol(String currency) Sets the currency symbol for the currency of these DecimalFormatSymbols in their locale. |
void |
setDecimalSeparator(char decimalSeparator) Sets the character used for decimal sign. |
void |
setDigit(char digit) Sets the character used for a digit in a pattern. |
void |
Sets the string used to separate the mantissa from the exponent. |
void |
setGroupingSeparator(char groupingSeparator) Sets the character used for thousands separator. |
void |
setInfinity(String infinity) Sets the string used to represent infinity. |
void |
setInternationalCurrencySymbol(String currencyCode) Sets the ISO 4217 currency code of the currency of these DecimalFormatSymbols. |
void |
setMinusSign(char minusSign) Sets the character used to represent minus sign. |
void |
setMonetaryDecimalSeparator(char sep) Sets the monetary decimal separator. |
void |
Sets the string used to represent "not a number". |
void |
setPatternSeparator(char patternSeparator) Sets the character used to separate positive and negative subpatterns in a pattern. |
void |
setPercent(char percent) Sets the character used for percent sign. |
void |
setPerMill(char perMill) Sets the character used for per mille sign. |
void |
setZeroDigit(char zeroDigit) Sets the character used for zero. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DecimalFormatSymbols()
public DecimalFormatSymbols(Locale locale)
locale
Method Detail |
---|
public Object clone()
clone
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
public static Locale[] getAvailableLocales()
getInstance
methods of this class can return
localized instances.
The returned array represents the union of locales supported by the Java
runtime and by installed
{@link java.text.spi.DecimalFormatSymbolsProvider DecimalFormatSymbolsProvider}
implementations. It must contain at least a Locale
instance equal to {@link java.util.Locale#US Locale.US}.
DecimalFormatSymbols
instances are available.public Currency getCurrency()
public String getCurrencySymbol()
public char getDecimalSeparator()
public char getDigit()
public String getExponentSeparator()
public char getGroupingSeparator()
public String getInfinity()
public static final DecimalFormatSymbols getInstance()
DecimalFormatSymbols
instance for the default
locale. This method provides access to DecimalFormatSymbols
instances for locales supported by the Java runtime itself as well
as for those supported by installed
{@link java.text.spi.DecimalFormatSymbolsProvider
DecimalFormatSymbolsProvider} implementations.
DecimalFormatSymbols
instance.public static final DecimalFormatSymbols getInstance(Locale locale)
DecimalFormatSymbols
instance for the specified
locale. This method provides access to DecimalFormatSymbols
instances for locales supported by the Java runtime itself as well
as for those supported by installed
{@link java.text.spi.DecimalFormatSymbolsProvider
DecimalFormatSymbolsProvider} implementations.
locale
- the desired locale.DecimalFormatSymbols
instance.public String getInternationalCurrencySymbol()
public char getMinusSign()
public char getMonetaryDecimalSeparator()
public String getNaN()
public char getPatternSeparator()
public char getPercent()
public char getPerMill()
public char getZeroDigit()
public int hashCode()
hashCode
in class Object
public void setCurrency(Currency currency)
currency
- the new currency to be usedpublic void setCurrencySymbol(String currency)
currency
public void setDecimalSeparator(char decimalSeparator)
decimalSeparator
public void setDigit(char digit)
digit
public void setExponentSeparator(String exp)
exp
- the exponent separator stringpublic void setGroupingSeparator(char groupingSeparator)
groupingSeparator
public void setInfinity(String infinity)
infinity
public void setInternationalCurrencySymbol(String currencyCode)
currencyCode
public void setMinusSign(char minusSign)
minusSign
public void setMonetaryDecimalSeparator(char sep)
sep
public void setNaN(String NaN)
NaN
public void setPatternSeparator(char patternSeparator)
patternSeparator
public void setPercent(char percent)
percent
public void setPerMill(char perMill)
perMill
public void setZeroDigit(char zeroDigit)
zeroDigit
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |