Final

java.text
Class DecimalFormatSymbols

java.lang.Object
  extended by java.text.DecimalFormatSymbols
All Implemented Interfaces:
Serializable, Cloneable

public final class DecimalFormatSymbols
extends Object
implements Cloneable, Serializable

DecimalFormatSymbols holds the symbols used in the formating and parsing of numbers.

See Also:
Serialized Form

Constructor Summary
DecimalFormatSymbols()
          Constructs a new DecimalFormatSymbols containing the symbols for the default Locale.
DecimalFormatSymbols(Locale locale)
          Constructs a new DecimalFormatSymbols containing the symbols for the specified Locale.
 
Method Summary
 Object clone()
          Answers a new DecimalFormatSymbols with the same symbols as this DecimalFormatSymbols.
 boolean equals(Object object)
          Compares the specified object to this DecimalFormatSymbols and answer if they are equal.
 Currency getCurrency()
          Answers the currency.
 String getCurrencySymbol()
          Answers the currency symbol.
 char getDecimalSeparator()
          Answers the character which represents the decimal point in a number.
 char getDigit()
          Answers the character which represents a single digit in a format pattern.
 char getGroupingSeparator()
          Answers the character used as the thousands separator in a number.
 String getInfinity()
          Answers the String which represents infinity.
 String getInternationalCurrencySymbol()
          Answers the international currency symbol.
 char getMinusSign()
          Answers the minus sign character.
 char getMonetaryDecimalSeparator()
          Answers the character which represents the decimal point in a monetary value.
 String getNaN()
          Answers the String which represents NaN.
 char getPatternSeparator()
          Answers the character which separates the positive and negative patterns in a format pattern.
 char getPercent()
          Answers the percent character.
 char getPerMill()
          Answers the mille percent sign character.
 char getZeroDigit()
          Answers the character which represents zero.
 int hashCode()
          Answers an integer hash code for the receiver.
 void setCurrency(Currency currency)
          Sets the currency.
 void setCurrencySymbol(String value)
          Sets the currency symbol.
 void setDecimalSeparator(char value)
          Sets the character which represents the decimal point in a number.
 void setDigit(char value)
          Sets the character which represents a single digit in a format pattern.
 void setGroupingSeparator(char value)
          Sets the character used as the thousands separator in a number.
 void setInfinity(String value)
          Sets the String which represents infinity.
 void setInternationalCurrencySymbol(String value)
          Sets the international currency symbol.
 void setMinusSign(char value)
          Sets the minus sign character.
 void setMonetaryDecimalSeparator(char value)
          Sets the character which represents the decimal point in a monetary value.
 void setNaN(String value)
          Sets the String which represents NaN.
 void setPatternSeparator(char value)
          Sets the character which separates the positive and negative patterns in a format pattern.
 void setPercent(char value)
          Sets the percent character.
 void setPerMill(char value)
          Sets the mille percent sign character.
 void setZeroDigit(char value)
          Sets the character which represents zero.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecimalFormatSymbols

public DecimalFormatSymbols()
Constructs a new DecimalFormatSymbols containing the symbols for the default Locale.


DecimalFormatSymbols

public DecimalFormatSymbols(Locale locale)
Constructs a new DecimalFormatSymbols containing the symbols for the specified Locale.

Parameters:
locale - the Locale
Method Detail

clone

public Object clone()
Answers a new DecimalFormatSymbols with the same symbols as this DecimalFormatSymbols.

Overrides:
clone in class Object
Returns:
a shallow copy of this DecimalFormatSymbols
See Also:
Cloneable

equals

public boolean equals(Object object)
Compares the specified object to this DecimalFormatSymbols and answer if they are equal. The object must be an instance of DecimalFormatSymbols with the same symbols.

Overrides:
equals in class Object
Parameters:
object - the object to compare with this object
Returns:
true if the specified object is equal to this DecimalFormatSymbols, false otherwise
See Also:
hashCode()

getCurrency

public Currency getCurrency()
Answers the currency.

null is returned if setInternationalCurrencySymbol() has been previously called with a value that is not a valid ISO 4217 currency code.

Returns:
the currency that was set in the constructor, setCurrency(), or setInternationalCurrencySymbol(), or null
See Also:
setCurrency(Currency), setInternationalCurrencySymbol(String)

getInternationalCurrencySymbol

public String getInternationalCurrencySymbol()
Answers the international currency symbol.

Returns:
a String

getCurrencySymbol

public String getCurrencySymbol()
Answers the currency symbol.

Returns:
a String

getDecimalSeparator

public char getDecimalSeparator()
Answers the character which represents the decimal point in a number.

Returns:
a char

getDigit

public char getDigit()
Answers the character which represents a single digit in a format pattern.

Returns:
a char

getGroupingSeparator

public char getGroupingSeparator()
Answers the character used as the thousands separator in a number.

Returns:
a char

getInfinity

public String getInfinity()
Answers the String which represents infinity.

Returns:
a String

getMinusSign

public char getMinusSign()
Answers the minus sign character.

Returns:
a char

getMonetaryDecimalSeparator

public char getMonetaryDecimalSeparator()
Answers the character which represents the decimal point in a monetary value.

Returns:
a char

getNaN

public String getNaN()
Answers the String which represents NaN.

Returns:
a String

getPatternSeparator

public char getPatternSeparator()
Answers the character which separates the positive and negative patterns in a format pattern.

Returns:
a char

getPercent

public char getPercent()
Answers the percent character.

Returns:
a char

getPerMill

public char getPerMill()
Answers the mille percent sign character.

Returns:
a char

getZeroDigit

public char getZeroDigit()
Answers the character which represents zero.

Returns:
a char

hashCode

public int hashCode()
Answers an integer hash code for the receiver. Objects which are equal answer the same value for this method.

Overrides:
hashCode in class Object
Returns:
the receiver's hash
See Also:
equals(java.lang.Object)

setCurrency

public void setCurrency(Currency currency)
Sets the currency.

The international currency symbol and currency symbol are updated, but the min and max number of fraction digits stay the same.

Parameters:
currency - the new currency
Throws:
NullPointerException - if currency is null

setInternationalCurrencySymbol

public void setInternationalCurrencySymbol(String value)
Sets the international currency symbol.

currency and currency symbol also are updated, if value is a valid ISO4217 currency code.

The min and max number of fraction digits stay the same.

Parameters:
value - currency code

setCurrencySymbol

public void setCurrencySymbol(String value)
Sets the currency symbol.

Parameters:
value - a String

setDecimalSeparator

public void setDecimalSeparator(char value)
Sets the character which represents the decimal point in a number.

Parameters:
value - the decimal separator character

setDigit

public void setDigit(char value)
Sets the character which represents a single digit in a format pattern.

Parameters:
value - the digit character

setGroupingSeparator

public void setGroupingSeparator(char value)
Sets the character used as the thousands separator in a number.

Parameters:
value - the grouping separator character

setInfinity

public void setInfinity(String value)
Sets the String which represents infinity.

Parameters:
value - the String

setMinusSign

public void setMinusSign(char value)
Sets the minus sign character.

Parameters:
value - the minus sign character

setMonetaryDecimalSeparator

public void setMonetaryDecimalSeparator(char value)
Sets the character which represents the decimal point in a monetary value.

Parameters:
value - the monetary decimal separator character

setNaN

public void setNaN(String value)
Sets the String which represents NaN.

Parameters:
value - the String

setPatternSeparator

public void setPatternSeparator(char value)
Sets the character which separates the positive and negative patterns in a format pattern.

Parameters:
value - the pattern separator character

setPercent

public void setPercent(char value)
Sets the percent character.

Parameters:
value - the percent character

setPerMill

public void setPerMill(char value)
Sets the mille percent sign character.

Parameters:
value - the mille percent character

setZeroDigit

public void setZeroDigit(char value)
Sets the character which represents zero.

Parameters:
value - the zero digit character

Final

Licensed Materials - Property of IBM
© Copyright IBM Corp. 2006, 2008 All Rights Reserved.