com.ibm.icu.text
Class DecimalFormatSymbols

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

public final class DecimalFormatSymbols
extends java.lang.Object
implements java.lang.Cloneable, 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.

This is an enhanced version of DecimalFormatSymbols that is based on the standard version in the JDK. New or changed functionality is labeled NEW.

Version:
1.12 29 Jan 1997
Author:
Mark Davis, Alan Liu
See Also:
Locale, DecimalFormat, Serialized Form

Constructor Summary
DecimalFormatSymbols()
          Create a DecimalFormatSymbols object for the default locale.
DecimalFormatSymbols(java.util.Locale locale)
          Create a DecimalFormatSymbols object for the given locale.
 
Method Summary
 java.lang.Object clone()
          Standard override.
 boolean equals(java.lang.Object obj)
          Override equals
 java.lang.String getCurrencySymbol()
          Return the string denoting the local currency.
 char getDecimalSeparator()
          character used for decimal sign.
 char getDigit()
          character used for a digit in a pattern.
 java.lang.String getExponentSeparator()
          NEW Return the string used to separate the mantissa from the exponent.
 char getGroupingSeparator()
          character used for thousands separator.
 java.lang.String getInfinity()
          String used to represent infinity.
 java.lang.String getInternationalCurrencySymbol()
          Return the international string denoting the local currency.
 char getMinusSign()
          character used to represent minus sign.
 char getMonetaryDecimalSeparator()
          Return the monetary decimal separator.
 java.lang.String getNaN()
          String used to represent NaN.
 char getPadEscape()
          NEW Return the character used to pad numbers out to a specified width.
 char getPatternSeparator()
          character used to separate positive and negative subpatterns in a pattern.
 char getPercent()
          character used for percent sign.
 char getPerMill()
          character used for mille percent sign.
 char getPlusSign()
          NEW Return the localized plus sign.
 char getZeroDigit()
          character used for zero.
 int hashCode()
          Override hashCode
 void setCurrencySymbol(java.lang.String currency)
          Set the string denoting the local currency.
 void setDecimalSeparator(char decimalSeparator)
           
 void setDigit(char digit)
           
 void setExponentSeparator(java.lang.String exp)
          NEW Set the string used to separate the mantissa from the exponent.
 void setGroupingSeparator(char groupingSeparator)
           
 void setInfinity(java.lang.String infinity)
           
 void setInternationalCurrencySymbol(java.lang.String currency)
          Set the international string denoting the local currency.
 void setMinusSign(char minusSign)
           
 void setMonetaryDecimalSeparator(char sep)
          Set the monetary decimal separator.
 void setNaN(java.lang.String NaN)
           
 void setPadEscape(char c)
          NEW Set the character used to pad numbers out to a specified width.
 void setPatternSeparator(char patternSeparator)
           
 void setPercent(char percent)
           
 void setPerMill(char perMill)
           
 void setPlusSign(char plus)
          NEW Set the localized plus sign.
 void setZeroDigit(char zeroDigit)
           
 
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(java.util.Locale locale)
Create a DecimalFormatSymbols object for the given locale.
Method Detail

getZeroDigit

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

setZeroDigit

public void setZeroDigit(char zeroDigit)

getGroupingSeparator

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

setGroupingSeparator

public void setGroupingSeparator(char groupingSeparator)

getDecimalSeparator

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

setDecimalSeparator

public void setDecimalSeparator(char decimalSeparator)

getPerMill

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

setPerMill

public void setPerMill(char perMill)

getPercent

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

setPercent

public void setPercent(char percent)

getDigit

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

setDigit

public void setDigit(char digit)

getPatternSeparator

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

setPatternSeparator

public void setPatternSeparator(char patternSeparator)

getInfinity

public java.lang.String getInfinity()
String used to represent infinity. Almost always left unchanged.

setInfinity

public void setInfinity(java.lang.String infinity)

getNaN

public java.lang.String getNaN()
String used to represent NaN. Almost always left unchanged.

setNaN

public void setNaN(java.lang.String NaN)

getMinusSign

public char getMinusSign()
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)

getCurrencySymbol

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

setCurrencySymbol

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

getInternationalCurrencySymbol

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

setInternationalCurrencySymbol

public void setInternationalCurrencySymbol(java.lang.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.

getExponentSeparator

public java.lang.String getExponentSeparator()
NEW Return the string used to separate the mantissa from the exponent. Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.
Returns:
the localized exponent symbol, used in localized patterns and formatted strings
See Also:
setExponentSeparator(java.lang.String)

setExponentSeparator

public void setExponentSeparator(java.lang.String exp)
NEW Set the string used to separate the mantissa from the exponent. Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.
Parameters:
exp - the localized exponent symbol, used in localized patterns and formatted strings
See Also:
getExponentSeparator()

getPlusSign

public char getPlusSign()
NEW Return the localized plus sign.
Returns:
the plus sign, used in localized patterns and formatted strings
See Also:
setPlusSign(char), setMinusSign(char), getMinusSign()

setPlusSign

public void setPlusSign(char plus)
NEW Set the localized plus sign.
Parameters:
plus - the plus sign, used in localized patterns and formatted strings
See Also:
getPlusSign(), setMinusSign(char), getMinusSign()

getPadEscape

public char getPadEscape()
NEW Return the character used to pad numbers out to a specified width. This is not the pad character itself; rather, it is the special pattern character preceding the pad character. In the pattern "*_#,##0", '*' is the pad escape, and '_' is the pad character.
Returns:
the character
See Also:
setPadEscape(char), DecimalFormat.getFormatWidth(), DecimalFormat.getPadPosition(), DecimalFormat.getPadCharacter()

setPadEscape

public void setPadEscape(char c)
NEW Set the character used to pad numbers out to a specified width. This is not the pad character itself; rather, it is the special pattern character preceding the pad character. In the pattern "*_#,##0", '*' is the pad escape, and '_' is the pad character.
See Also:
getPadEscape(), DecimalFormat.setFormatWidth(int), DecimalFormat.setPadPosition(int), DecimalFormat.setPadCharacter(char)

clone

public java.lang.Object clone()
Standard override.
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Override equals
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Override hashCode
Overrides:
hashCode in class java.lang.Object


Copyright (c) 2001 IBM Corporation and others.