java.text

Class DecimalFormatSymbols

public final class DecimalFormatSymbols extends Object implements Cloneable, Serializable

This class is a container for the symbols used by DecimalFormat to format numbers and currency. These are normally handled automatically, but an application can override values as desired using this class.

UNKNOWN: February 24, 1999

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
Objectclone()
booleanequals(Object obj)
This method this this object for equality against the specified object.
CurrencygetCurrency()
Returns the currency corresponding to the currency symbol stored in the instance of DecimalFormatSymbols.
StringgetCurrencySymbol()
This method returns the currency symbol in local format.
chargetDecimalSeparator()
This method returns the character used as the decimal point.
chargetDigit()
This method returns the character used to represent a digit in a format pattern string.
chargetGroupingSeparator()
This method sets the character used to separate groups of digits.
StringgetInfinity()
This method returns the character used to represent infinity.
StringgetInternationalCurrencySymbol()
This method returns the currency symbol in international format.
chargetMinusSign()
This method returns the character used to represent the minus sign.
chargetMonetaryDecimalSeparator()
This method returns the character used to represent the decimal point for currency values.
StringgetNaN()
This method returns the string used to represent the NaN (not a number) value.
chargetPatternSeparator()
This method returns the character used to separate positive and negative subpatterns in a format pattern.
chargetPercent()
This method returns the character used as the percent sign.
chargetPerMill()
This method returns the character used as the per mille character.
chargetZeroDigit()
This method returns the character used to represent the digit zero.
inthashCode()
This method returns a hash value for this object.
voidsetCurrency(Currency currency)
This method sets the currency to the specified value.
voidsetCurrencySymbol(String currency)
This method sets the currency symbol to the specified value.
voidsetDecimalSeparator(char decimalSep)
This method sets the decimal point character to the specified value.
voidsetDigit(char digit)
This method sets the character used to represents a digit in a format string to the specified value.
voidsetGroupingSeparator(char groupSep)
This method sets the character used to separate groups of digits.
voidsetInfinity(String infinity)
This method sets the string used to represents infinity.
voidsetInternationalCurrencySymbol(String currency)
This method sets the international currency symbols to the specified value.
voidsetMinusSign(char minusSign)
This method sets the character used to represent the minus sign.
voidsetMonetaryDecimalSeparator(char decimalSep)
This method sets the character used for the decimal point in currency values.
voidsetNaN(String nan)
This method sets the string used to represent the NaN (not a number) value.
voidsetPatternSeparator(char patternSep)
This method sets the character used to separate positive and negative subpatterns in a format pattern.
voidsetPercent(char percent)
This method sets the character used as the percent sign.
voidsetPerMill(char perMill)
This method sets the character used as the per mille character.
voidsetZeroDigit(char zeroDigit)
This method sets the character used to represent the digit zero.

Constructor Detail

DecimalFormatSymbols

public DecimalFormatSymbols()
This method initializes a new instance of DecimalFormatSymbols for the default locale.

DecimalFormatSymbols

public DecimalFormatSymbols(Locale loc)
This method initializes a new instance of DecimalFormatSymbols for the specified locale.

Parameters: loc The local to load symbols for.

Method Detail

clone

public Object clone()

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:

Returns: 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 the instance of DecimalFormatSymbols.

Returns: A new instance of Currency if the currency code matches a known one.

getCurrencySymbol

public String getCurrencySymbol()
This method returns the currency symbol in local format. For example, "$" for Canadian dollars.

Returns: The currency symbol in local format.

getDecimalSeparator

public char getDecimalSeparator()
This method returns the character used as the decimal point.

Returns: 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.

Returns: 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.

Returns: The character used to separate groups of digits.

getInfinity

public String getInfinity()
This method returns the character used to represent infinity.

Returns: The character used to represent infinity.

getInternationalCurrencySymbol

public String getInternationalCurrencySymbol()
This method returns the currency symbol in international format. For example, "C$" for Canadian dollars.

Returns: The currency symbol in international format.

getMinusSign

public char getMinusSign()
This method returns the character used to represent the minus sign.

Returns: 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.

Returns: 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.

Returns: 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.

Returns: The character used to separate positive and negative subpatterns in a format pattern.

getPercent

public char getPercent()
This method returns the character used as the percent sign.

Returns: The character used as the percent sign.

getPerMill

public char getPerMill()
This method returns the character used as the per mille character.

Returns: The per mille character.

getZeroDigit

public char getZeroDigit()
This method returns the character used to represent the digit zero.

Returns: The character used to represent the digit zero.

hashCode

public int hashCode()
This method returns a hash value for this object.

Returns: A hash value for this object.

setCurrency

public void setCurrency(Currency currency)
This method sets the currency to the specified value.

Parameters: currency The new currency

setCurrencySymbol

public void setCurrencySymbol(String currency)
This method sets the currency symbol to the specified value.

Parameters: currency The new currency symbol

setDecimalSeparator

public void setDecimalSeparator(char decimalSep)
This method sets the decimal point character to the specified value.

Parameters: 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.

Parameters: 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.

Parameters: groupSep The character used to separate groups of digits.

setInfinity

public void setInfinity(String infinity)
This method sets the string used to represents infinity.

Parameters: infinity The string used to represent infinity.

setInternationalCurrencySymbol

public void setInternationalCurrencySymbol(String currency)
This method sets the international currency symbols to the specified value.

Parameters: intlCurrencySymbol The new international currency symbol.

setMinusSign

public void setMinusSign(char minusSign)
This method sets the character used to represent the minus sign.

Parameters: 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.

Parameters: 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.

Parameters: 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.

Parameters: patternSep The character used to separate positive and negative subpatterns in a format pattern.

setPercent

public void setPercent(char percent)
This method sets the character used as the percent sign.

Parameters: percent The character used as the percent sign.

setPerMill

public void setPerMill(char perMill)
This method sets the character used as the per mille character.

Parameters: perMill The per mille character.

setZeroDigit

public void setZeroDigit(char zeroDigit)
This method sets the character used to represent the digit zero.

Parameters: zeroDigit The character used to represent the digit zero.