java.text
Class DecimalFormatSymbols

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.text.DecimalFormatSymbols
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

public final class DecimalFormatSymbols
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable , Serializable sample code for java.io.Serializable definition code for java.io.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 sample code for java.util.Locale definition code for java.util.Locale , DecimalFormat sample code for java.text.DecimalFormat definition code for java.text.DecimalFormat , Serialized Form

Constructor Summary
DecimalFormatSymbols sample code for java.text.DecimalFormatSymbols.DecimalFormatSymbols() definition code for java.text.DecimalFormatSymbols.DecimalFormatSymbols() ()
          Create a DecimalFormatSymbols object for the default locale.
DecimalFormatSymbols sample code for java.text.DecimalFormatSymbols.DecimalFormatSymbols(java.util.Locale) definition code for java.text.DecimalFormatSymbols.DecimalFormatSymbols(java.util.Locale) (Locale sample code for java.util.Locale definition code for java.util.Locale  locale)
          Create a DecimalFormatSymbols object for the given locale.
 
Method Summary
 Object sample code for java.lang.Object definition code for java.lang.Object clone sample code for java.text.DecimalFormatSymbols.clone() definition code for java.text.DecimalFormatSymbols.clone() ()
          Standard override.
 boolean equals sample code for java.text.DecimalFormatSymbols.equals(java.lang.Object) definition code for java.text.DecimalFormatSymbols.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Override equals.
 Currency sample code for java.util.Currency definition code for java.util.Currency getCurrency sample code for java.text.DecimalFormatSymbols.getCurrency() definition code for java.text.DecimalFormatSymbols.getCurrency() ()
          Gets the currency of these DecimalFormatSymbols.
 String sample code for java.lang.String definition code for java.lang.String getCurrencySymbol sample code for java.text.DecimalFormatSymbols.getCurrencySymbol() definition code for java.text.DecimalFormatSymbols.getCurrencySymbol() ()
          Returns the currency symbol for the currency of these DecimalFormatSymbols in their locale.
 char getDecimalSeparator sample code for java.text.DecimalFormatSymbols.getDecimalSeparator() definition code for java.text.DecimalFormatSymbols.getDecimalSeparator() ()
          Gets the character used for decimal sign.
 char getDigit sample code for java.text.DecimalFormatSymbols.getDigit() definition code for java.text.DecimalFormatSymbols.getDigit() ()
          Gets the character used for a digit in a pattern.
 char getGroupingSeparator sample code for java.text.DecimalFormatSymbols.getGroupingSeparator() definition code for java.text.DecimalFormatSymbols.getGroupingSeparator() ()
          Gets the character used for thousands separator.
 String sample code for java.lang.String definition code for java.lang.String getInfinity sample code for java.text.DecimalFormatSymbols.getInfinity() definition code for java.text.DecimalFormatSymbols.getInfinity() ()
          Gets the string used to represent infinity.
 String sample code for java.lang.String definition code for java.lang.String getInternationalCurrencySymbol sample code for java.text.DecimalFormatSymbols.getInternationalCurrencySymbol() definition code for java.text.DecimalFormatSymbols.getInternationalCurrencySymbol() ()
          Returns the ISO 4217 currency code of the currency of these DecimalFormatSymbols.
 char getMinusSign sample code for java.text.DecimalFormatSymbols.getMinusSign() definition code for java.text.DecimalFormatSymbols.getMinusSign() ()
          Gets the character used to represent minus sign.
 char getMonetaryDecimalSeparator sample code for java.text.DecimalFormatSymbols.getMonetaryDecimalSeparator() definition code for java.text.DecimalFormatSymbols.getMonetaryDecimalSeparator() ()
          Returns the monetary decimal separator.
 String sample code for java.lang.String definition code for java.lang.String getNaN sample code for java.text.DecimalFormatSymbols.getNaN() definition code for java.text.DecimalFormatSymbols.getNaN() ()
          Gets the string used to represent "not a number".
 char getPatternSeparator sample code for java.text.DecimalFormatSymbols.getPatternSeparator() definition code for java.text.DecimalFormatSymbols.getPatternSeparator() ()
          Gets the character used to separate positive and negative subpatterns in a pattern.
 char getPercent sample code for java.text.DecimalFormatSymbols.getPercent() definition code for java.text.DecimalFormatSymbols.getPercent() ()
          Gets the character used for percent sign.
 char getPerMill sample code for java.text.DecimalFormatSymbols.getPerMill() definition code for java.text.DecimalFormatSymbols.getPerMill() ()
          Gets the character used for per mille sign.
 char getZeroDigit sample code for java.text.DecimalFormatSymbols.getZeroDigit() definition code for java.text.DecimalFormatSymbols.getZeroDigit() ()
          Gets the character used for zero.
 int hashCode sample code for java.text.DecimalFormatSymbols.hashCode() definition code for java.text.DecimalFormatSymbols.hashCode() ()
          Override hashCode.
 void setCurrency sample code for java.text.DecimalFormatSymbols.setCurrency(java.util.Currency) definition code for java.text.DecimalFormatSymbols.setCurrency(java.util.Currency) (Currency sample code for java.util.Currency definition code for java.util.Currency  currency)
          Sets the currency of these DecimalFormatSymbols.
 void setCurrencySymbol sample code for java.text.DecimalFormatSymbols.setCurrencySymbol(java.lang.String) definition code for java.text.DecimalFormatSymbols.setCurrencySymbol(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  currency)
          Sets the currency symbol for the currency of these DecimalFormatSymbols in their locale.
 void setDecimalSeparator sample code for java.text.DecimalFormatSymbols.setDecimalSeparator(char) definition code for java.text.DecimalFormatSymbols.setDecimalSeparator(char) (char decimalSeparator)
          Sets the character used for decimal sign.
 void setDigit sample code for java.text.DecimalFormatSymbols.setDigit(char) definition code for java.text.DecimalFormatSymbols.setDigit(char) (char digit)
          Sets the character used for a digit in a pattern.
 void setGroupingSeparator sample code for java.text.DecimalFormatSymbols.setGroupingSeparator(char) definition code for java.text.DecimalFormatSymbols.setGroupingSeparator(char) (char groupingSeparator)
          Sets the character used for thousands separator.
 void setInfinity sample code for java.text.DecimalFormatSymbols.setInfinity(java.lang.String) definition code for java.text.DecimalFormatSymbols.setInfinity(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  infinity)
          Sets the string used to represent infinity.
 void setInternationalCurrencySymbol sample code for java.text.DecimalFormatSymbols.setInternationalCurrencySymbol(java.lang.String) definition code for java.text.DecimalFormatSymbols.setInternationalCurrencySymbol(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  currencyCode)
          Sets the ISO 4217 currency code of the currency of these DecimalFormatSymbols.
 void setMinusSign sample code for java.text.DecimalFormatSymbols.setMinusSign(char) definition code for java.text.DecimalFormatSymbols.setMinusSign(char) (char minusSign)
          Sets the character used to represent minus sign.
 void setMonetaryDecimalSeparator sample code for java.text.DecimalFormatSymbols.setMonetaryDecimalSeparator(char) definition code for java.text.DecimalFormatSymbols.setMonetaryDecimalSeparator(char) (char sep)
          Sets the monetary decimal separator.
 void setNaN sample code for java.text.DecimalFormatSymbols.setNaN(java.lang.String) definition code for java.text.DecimalFormatSymbols.setNaN(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  NaN)
          Sets the string used to represent "not a number".
 void setPatternSeparator sample code for java.text.DecimalFormatSymbols.setPatternSeparator(char) definition code for java.text.DecimalFormatSymbols.setPatternSeparator(char) (char patternSeparator)
          Sets the character used to separate positive and negative subpatterns in a pattern.
 void setPercent sample code for java.text.DecimalFormatSymbols.setPercent(char) definition code for java.text.DecimalFormatSymbols.setPercent(char) (char percent)
          Sets the character used for percent sign.
 void setPerMill sample code for java.text.DecimalFormatSymbols.setPerMill(char) definition code for java.text.DecimalFormatSymbols.setPerMill(char) (char perMill)
          Sets the character used for per mille sign.
 void setZeroDigit sample code for java.text.DecimalFormatSymbols.setZeroDigit(char) definition code for java.text.DecimalFormatSymbols.setZeroDigit(char) (char zeroDigit)
          Sets the character used for zero.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

DecimalFormatSymbols sample code for java.text.DecimalFormatSymbols() definition code for java.text.DecimalFormatSymbols()

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


DecimalFormatSymbols sample code for java.text.DecimalFormatSymbols(java.util.Locale) definition code for java.text.DecimalFormatSymbols(java.util.Locale)

public DecimalFormatSymbols(Locale sample code for java.util.Locale definition code for java.util.Locale  locale)
Create a DecimalFormatSymbols object for the given locale.

Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if locale is null
Method Detail

getZeroDigit sample code for java.text.DecimalFormatSymbols.getZeroDigit() definition code for java.text.DecimalFormatSymbols.getZeroDigit()

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


setZeroDigit sample code for java.text.DecimalFormatSymbols.setZeroDigit(char) definition code for java.text.DecimalFormatSymbols.setZeroDigit(char)

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


getGroupingSeparator sample code for java.text.DecimalFormatSymbols.getGroupingSeparator() definition code for java.text.DecimalFormatSymbols.getGroupingSeparator()

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


setGroupingSeparator sample code for java.text.DecimalFormatSymbols.setGroupingSeparator(char) definition code for java.text.DecimalFormatSymbols.setGroupingSeparator(char)

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


getDecimalSeparator sample code for java.text.DecimalFormatSymbols.getDecimalSeparator() definition code for java.text.DecimalFormatSymbols.getDecimalSeparator()

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


setDecimalSeparator sample code for java.text.DecimalFormatSymbols.setDecimalSeparator(char) definition code for java.text.DecimalFormatSymbols.setDecimalSeparator(char)

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


getPerMill sample code for java.text.DecimalFormatSymbols.getPerMill() definition code for java.text.DecimalFormatSymbols.getPerMill()

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


setPerMill sample code for java.text.DecimalFormatSymbols.setPerMill(char) definition code for java.text.DecimalFormatSymbols.setPerMill(char)

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


getPercent sample code for java.text.DecimalFormatSymbols.getPercent() definition code for java.text.DecimalFormatSymbols.getPercent()

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


setPercent sample code for java.text.DecimalFormatSymbols.setPercent(char) definition code for java.text.DecimalFormatSymbols.setPercent(char)

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


getDigit sample code for java.text.DecimalFormatSymbols.getDigit() definition code for java.text.DecimalFormatSymbols.getDigit()

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


setDigit sample code for java.text.DecimalFormatSymbols.setDigit(char) definition code for java.text.DecimalFormatSymbols.setDigit(char)

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


getPatternSeparator sample code for java.text.DecimalFormatSymbols.getPatternSeparator() definition code for java.text.DecimalFormatSymbols.getPatternSeparator()

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


setPatternSeparator sample code for java.text.DecimalFormatSymbols.setPatternSeparator(char) definition code for java.text.DecimalFormatSymbols.setPatternSeparator(char)

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


getInfinity sample code for java.text.DecimalFormatSymbols.getInfinity() definition code for java.text.DecimalFormatSymbols.getInfinity()

public String sample code for java.lang.String definition code for java.lang.String  getInfinity()
Gets the string used to represent infinity. Almost always left unchanged.


setInfinity sample code for java.text.DecimalFormatSymbols.setInfinity(java.lang.String) definition code for java.text.DecimalFormatSymbols.setInfinity(java.lang.String)

public void setInfinity(String sample code for java.lang.String definition code for java.lang.String  infinity)
Sets the string used to represent infinity. Almost always left unchanged.


getNaN sample code for java.text.DecimalFormatSymbols.getNaN() definition code for java.text.DecimalFormatSymbols.getNaN()

public String sample code for java.lang.String definition code for java.lang.String  getNaN()
Gets the string used to represent "not a number". Almost always left unchanged.


setNaN sample code for java.text.DecimalFormatSymbols.setNaN(java.lang.String) definition code for java.text.DecimalFormatSymbols.setNaN(java.lang.String)

public void setNaN(String sample code for java.lang.String definition code for java.lang.String  NaN)
Sets the string used to represent "not a number". Almost always left unchanged.


getMinusSign sample code for java.text.DecimalFormatSymbols.getMinusSign() definition code for java.text.DecimalFormatSymbols.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 sample code for java.text.DecimalFormatSymbols.setMinusSign(char) definition code for java.text.DecimalFormatSymbols.setMinusSign(char)

public void setMinusSign(char minusSign)
Sets 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 sample code for java.text.DecimalFormatSymbols.getCurrencySymbol() definition code for java.text.DecimalFormatSymbols.getCurrencySymbol()

public String sample code for java.lang.String definition code for java.lang.String  getCurrencySymbol()
Returns the currency symbol for the currency of these DecimalFormatSymbols in their locale.

Since:
1.2

setCurrencySymbol sample code for java.text.DecimalFormatSymbols.setCurrencySymbol(java.lang.String) definition code for java.text.DecimalFormatSymbols.setCurrencySymbol(java.lang.String)

public void setCurrencySymbol(String sample code for java.lang.String definition code for java.lang.String  currency)
Sets the currency symbol for the currency of these DecimalFormatSymbols in their locale.

Since:
1.2

getInternationalCurrencySymbol sample code for java.text.DecimalFormatSymbols.getInternationalCurrencySymbol() definition code for java.text.DecimalFormatSymbols.getInternationalCurrencySymbol()

public String sample code for java.lang.String definition code for java.lang.String  getInternationalCurrencySymbol()
Returns the ISO 4217 currency code of the currency of these DecimalFormatSymbols.

Since:
1.2

setInternationalCurrencySymbol sample code for java.text.DecimalFormatSymbols.setInternationalCurrencySymbol(java.lang.String) definition code for java.text.DecimalFormatSymbols.setInternationalCurrencySymbol(java.lang.String)

public void setInternationalCurrencySymbol(String sample code for java.lang.String definition code for java.lang.String  currencyCode)
Sets the ISO 4217 currency code of the currency of these DecimalFormatSymbols. If the currency code is valid (as defined by Currency.getInstance sample code for java.util.Currency.getInstance(java.lang.String) definition code for java.util.Currency.getInstance(java.lang.String) ), this also sets the currency attribute to the corresponding Currency instance and the currency symbol attribute to the currency's symbol in the DecimalFormatSymbols' locale. If the currency code is not valid, then the currency attribute is set to null and the currency symbol attribute is not modified.

Since:
1.2
See Also:
setCurrency(java.util.Currency) sample code for java.text.DecimalFormatSymbols.setCurrency(java.util.Currency) definition code for java.text.DecimalFormatSymbols.setCurrency(java.util.Currency) , setCurrencySymbol(java.lang.String) sample code for java.text.DecimalFormatSymbols.setCurrencySymbol(java.lang.String) definition code for java.text.DecimalFormatSymbols.setCurrencySymbol(java.lang.String)

getCurrency sample code for java.text.DecimalFormatSymbols.getCurrency() definition code for java.text.DecimalFormatSymbols.getCurrency()

public Currency sample code for java.util.Currency definition code for java.util.Currency  getCurrency()
Gets the currency of these DecimalFormatSymbols. May be null if the currency symbol attribute was previously set to a value that's not a valid ISO 4217 currency code.

Returns:
the currency used, or null
Since:
1.4

setCurrency sample code for java.text.DecimalFormatSymbols.setCurrency(java.util.Currency) definition code for java.text.DecimalFormatSymbols.setCurrency(java.util.Currency)

public void setCurrency(Currency sample code for java.util.Currency definition code for java.util.Currency  currency)
Sets the currency of these DecimalFormatSymbols. This also sets the currency symbol attribute to the currency's symbol in the DecimalFormatSymbols' locale, and the international currency symbol attribute to the currency's ISO 4217 currency code.

Parameters:
currency - the new currency to be used
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if currency is null
Since:
1.4
See Also:
setCurrencySymbol(java.lang.String) sample code for java.text.DecimalFormatSymbols.setCurrencySymbol(java.lang.String) definition code for java.text.DecimalFormatSymbols.setCurrencySymbol(java.lang.String) , setInternationalCurrencySymbol(java.lang.String) sample code for java.text.DecimalFormatSymbols.setInternationalCurrencySymbol(java.lang.String) definition code for java.text.DecimalFormatSymbols.setInternationalCurrencySymbol(java.lang.String)

getMonetaryDecimalSeparator sample code for java.text.DecimalFormatSymbols.getMonetaryDecimalSeparator() definition code for java.text.DecimalFormatSymbols.getMonetaryDecimalSeparator()

public char getMonetaryDecimalSeparator()
Returns the monetary decimal separator.

Since:
1.2

setMonetaryDecimalSeparator sample code for java.text.DecimalFormatSymbols.setMonetaryDecimalSeparator(char) definition code for java.text.DecimalFormatSymbols.setMonetaryDecimalSeparator(char)

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

Since:
1.2

clone sample code for java.text.DecimalFormatSymbols.clone() definition code for java.text.DecimalFormatSymbols.clone()

public Object sample code for java.lang.Object definition code for java.lang.Object  clone()
Standard override.

Overrides:
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a clone of this instance.
See Also:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

equals sample code for java.text.DecimalFormatSymbols.equals(java.lang.Object) definition code for java.text.DecimalFormatSymbols.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Override equals.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for 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:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for java.text.DecimalFormatSymbols.hashCode() definition code for java.text.DecimalFormatSymbols.hashCode()

public int hashCode()
Override hashCode.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable