JavaTM 2 Platform
Std. Ed. v1.3.1

java.text
Class DecimalFormatSymbols

java.lang.Object
  |
  +--java.text.DecimalFormatSymbols
All Implemented Interfaces:
Cloneable, Serializable

public final 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.

See Also:
Locale, DecimalFormat, Serialized Form

Constructor Summary
DecimalFormatSymbols()
          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 equals(Object obj)
          Override equals.
 String getCurrencySymbol()
          Return the string denoting the local currency.
 char getDecimalSeparator()
          Gets the character used for decimal sign.
 char getDigit()
          Gets the character used for a digit in a pattern.
 char getGroupingSeparator()
          Gets the character used for thousands separator.
 String getInfinity()
          Gets the character used to represent infinity.
 String getInternationalCurrencySymbol()
          Return the international string denoting the local currency.
 char getMinusSign()
          Gets the character used to represent minus sign.
 char getMonetaryDecimalSeparator()
          Return the monetary decimal separator.
 String getNaN()
          Gets the character used to represent NaN.
 char getPatternSeparator()
          Gets the character used to separate positive and negative subpatterns in a pattern.
 char getPercent()
          Gets the character used for percent sign.
 char getPerMill()
          Gets the character used for mille percent sign.
 char getZeroDigit()
          Gets the character used for zero.
 int hashCode()
          Override hashCode.
 void setCurrencySymbol(String currency)
          Set the string denoting the local currency.
 void setDecimalSeparator(char decimalSeparator)
          Set the character used for decimal sign.
 void setDigit(char digit)
          Set the character used for a digit in a pattern.
 void setGroupingSeparator(char groupingSeparator)
          Set the character used for thousands separator.
 void setInfinity(String infinity)
          Set the character used to represent infinity.
 void setInternationalCurrencySymbol(String currency)
          Set the international string denoting the local currency.
 void setMinusSign(char minusSign)
          Set the character used to represent minus sign.
 void setMonetaryDecimalSeparator(char sep)
          Set the monetary decimal separator.
 void setNaN(String NaN)
          Set the character used to represent NaN.
 void setPatternSeparator(char patternSeparator)
          Set the character used to separate positive and negative subpatterns in a pattern.
 void setPercent(char percent)
          Set the character used for percent sign.
 void setPerMill(char perMill)
          Set the character used for mille percent sign.
 void setZeroDigit(char zeroDigit)
          Set the character used for zero.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecimalFormatSymbols

public DecimalFormatSymbols()
Create a DecimalFormatSymbols object for the default locale.

DecimalFormatSymbols

public DecimalFormatSymbols(Locale locale)
Create a DecimalFormatSymbols object for the given locale.
Method Detail

getZeroDigit

public char getZeroDigit()
Gets the character used for zero. Different for Arabic, etc.

setZeroDigit

public void setZeroDigit(char zeroDigit)
Set the character used for zero. Different for Arabic, etc.

getGroupingSeparator

public char getGroupingSeparator()
Gets the character used for thousands separator. Different for French, etc.

setGroupingSeparator

public void setGroupingSeparator(char groupingSeparator)
Set the character used for thousands separator. Different for French, etc.

getDecimalSeparator

public char getDecimalSeparator()
Gets the character used for decimal sign. Different for French, etc.

setDecimalSeparator

public void setDecimalSeparator(char decimalSeparator)
Set the character used for decimal sign. Different for French, etc.

getPerMill

public char getPerMill()
Gets the character used for mille percent sign. Different for Arabic, etc.

setPerMill

public void setPerMill(char perMill)
Set the character used for mille percent sign. Different for Arabic, etc.

getPercent

public char getPercent()
Gets the character used for percent sign. Different for Arabic, etc.

setPercent

public void setPercent(char percent)
Set the character used for percent sign. Different for Arabic, etc.

getDigit

public char getDigit()
Gets the character used for a digit in a pattern.

setDigit

public void setDigit(char digit)
Set the character used for a digit in a pattern.

getPatternSeparator

public char getPatternSeparator()
Gets the character used to separate positive and negative subpatterns in a pattern.

setPatternSeparator

public void setPatternSeparator(char patternSeparator)
Set the character used to separate positive and negative subpatterns in a pattern.

getInfinity

public String getInfinity()
Gets the character used to represent infinity. Almost always left unchanged.

setInfinity

public void setInfinity(String infinity)
Set the character used to represent infinity. Almost always left unchanged.

getNaN

public String getNaN()
Gets the character used to represent NaN. Almost always left unchanged.

setNaN

public void setNaN(String NaN)
Set the character used to represent NaN. Almost always left unchanged.

getMinusSign

public char getMinusSign()
Gets the character used to represent minus sign. If no explicit negative format is specified, one is formed by prefixing minusSign to the positive format.

setMinusSign

public void setMinusSign(char minusSign)
Set the character used to represent minus sign. If no explicit negative format is specified, one is formed by prefixing minusSign to the positive format.

getCurrencySymbol

public String getCurrencySymbol()
Return the string denoting the local currency.

setCurrencySymbol

public void setCurrencySymbol(String currency)
Set the string denoting the local currency.

getInternationalCurrencySymbol

public String getInternationalCurrencySymbol()
Return the international string denoting the local currency.

setInternationalCurrencySymbol

public void setInternationalCurrencySymbol(String currency)
Set the international string denoting the local currency.

getMonetaryDecimalSeparator

public char getMonetaryDecimalSeparator()
Return the monetary decimal separator.

setMonetaryDecimalSeparator

public void setMonetaryDecimalSeparator(char sep)
Set the monetary decimal separator.

clone

public Object clone()
Standard override.
Overrides:
clone in class Object
Following copied from class: java.lang.Object
Returns:
a clone of this instance.
Throws:
CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
OutOfMemoryError - if there is not enough memory.
See Also:
Cloneable

equals

public boolean equals(Object obj)
Override equals.
Overrides:
equals in class Object
Following copied from class: java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Boolean.hashCode(), Hashtable

hashCode

public int hashCode()
Override hashCode.
Overrides:
hashCode in class Object
Following copied from class: java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable

JavaTM 2 Platform
Std. Ed. v1.3.1

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Oracle and/or its affiliates, in the US and other countries.
Copyright © 1995, 2010 Oracle and/or its affiliates. All rights reserved.