|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.text.DecimalFormatSymbols
public final class DecimalFormatSymbols
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.
DecimalFormat,
Serialized Form| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
Object |
clone()
clone creates a shallow clone of this. |
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. |
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 |
getPercent()
This method returns the character used as the percent sign. |
char |
getPerMill()
This method returns the character used as the per mille character. |
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 |
setPercent(char percent)
This method sets the character used as the percent sign. |
void |
setPerMill(char perMill)
This method sets the character used as the per mille character. |
void |
setZeroDigit(char zeroDigit)
This method sets the character used to represent the digit zero. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DecimalFormatSymbols()
DecimalFormatSymbols for the default locale.
public DecimalFormatSymbols(Locale loc)
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.
loc - The local to load symbols for.
NullPointerException - if the locale is null.| Method Detail |
|---|
public Object clone()
Object
clone in class Objectpublic boolean equals(Object obj)
null.DecimalFormatSymbols.
equals in class Objectobj - the other object.
true if the specified object is equal to this
object, false otherwise.public Currency getCurrency()
DecimalFormatSymbols.
Currency which matches
the currency used, or null if there is no corresponding
instance.public String getCurrencySymbol()
public char getDecimalSeparator()
public char getDigit()
public char getGroupingSeparator()
public String getInfinity()
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 Objectpublic void setCurrency(Currency currency)
currency - the currency from which to obtain the values.
NullPointerException - if the currency is null.public void setCurrencySymbol(String currency)
currency - The new currency symbolpublic void setDecimalSeparator(char decimalSep)
decimalSep - The new decimal point characterpublic void setDigit(char digit)
digit - The character used to represent a digit in a format pattern.public void setGroupingSeparator(char groupSep)
groupSep - The character used to separate groups of digits.public void setInfinity(String infinity)
infinity - The string used to represent infinity.public void setInternationalCurrencySymbol(String currencyCode)
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.public void setMinusSign(char minusSign)
minusSign - The character used to represent the minus sign.public void setMonetaryDecimalSeparator(char decimalSep)
decimalSep - The decimal point character used in currency values.public void setNaN(String nan)
nan - The string used to represent NaNpublic void setPatternSeparator(char patternSep)
patternSep - The character used to separate positive and
negative subpatterns in a format pattern.public void setPercent(char percent)
percent - The character used as the percent sign.public void setPerMill(char perMill)
perMill - The per mille character.public void setZeroDigit(char zeroDigit)
zeroDigit - The character used to represent the digit zero.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||