Method from java.text.DecimalFormatSymbols Detail: |
public Object clone() {
try {
return (DecimalFormatSymbols)super.clone();
// other fields are bit-copied
} catch (CloneNotSupportedException e) {
throw new InternalError();
}
}
|
public boolean equals(Object obj) {
if (obj == null) return false;
if (this == obj) return true;
if (getClass() != obj.getClass()) return false;
DecimalFormatSymbols other = (DecimalFormatSymbols) obj;
return (zeroDigit == other.zeroDigit &&
groupingSeparator == other.groupingSeparator &&
decimalSeparator == other.decimalSeparator &&
percent == other.percent &&
perMill == other.perMill &&
digit == other.digit &&
minusSign == other.minusSign &&
patternSeparator == other.patternSeparator &&
infinity.equals(other.infinity) &&
NaN.equals(other.NaN) &&
currencySymbol.equals(other.currencySymbol) &&
intlCurrencySymbol.equals(other.intlCurrencySymbol) &&
currency == other.currency &&
monetarySeparator == other.monetarySeparator &&
exponentialSeparator.equals(other.exponentialSeparator) &&
locale.equals(other.locale));
}
|
public static Locale[] getAvailableLocales() {
LocaleServiceProviderPool pool =
LocaleServiceProviderPool.getPool(DecimalFormatSymbolsProvider.class);
return pool.getAvailableLocales();
}
Returns an array of all locales for which the
getInstance methods of this class can return
localized instances.
The returned array represents the union of locales supported by the Java
runtime and by installed
DecimalFormatSymbolsProvider
implementations. It must contain at least a Locale
instance equal to Locale.US . |
public Currency getCurrency() {
return currency;
}
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. |
public String getCurrencySymbol() {
return currencySymbol;
}
Returns the currency symbol for the currency of these
DecimalFormatSymbols in their locale. |
public char getDecimalSeparator() {
return decimalSeparator;
}
Gets the character used for decimal sign. Different for French, etc. |
public char getDigit() {
return digit;
}
Gets the character used for a digit in a pattern. |
public String getExponentSeparator() {
return exponentialSeparator;
}
Returns the string used to separate the mantissa from the exponent.
Examples: "x10^" for 1.23x10^4, "E" for 1.23E4. |
char getExponentialSymbol() {
return exponential;
}
Returns the character used to separate the mantissa from the exponent. |
public char getGroupingSeparator() {
return groupingSeparator;
}
Gets the character used for thousands separator. Different for French, etc. |
public String getInfinity() {
return infinity;
}
Gets the string used to represent infinity. Almost always left
unchanged. |
public static final DecimalFormatSymbols getInstance() {
return getInstance(Locale.getDefault(Locale.Category.FORMAT));
}
Gets the DecimalFormatSymbols instance for the default
locale. This method provides access to DecimalFormatSymbols
instances for locales supported by the Java runtime itself as well
as for those supported by installed
DecimalFormatSymbolsProvider implementations. |
public static final DecimalFormatSymbols getInstance(Locale locale) {
// Check whether a provider can provide an implementation that's closer
// to the requested locale than what the Java runtime itself can provide.
LocaleServiceProviderPool pool =
LocaleServiceProviderPool.getPool(DecimalFormatSymbolsProvider.class);
if (pool.hasProviders()) {
DecimalFormatSymbols providersInstance = pool.getLocalizedObject(
DecimalFormatSymbolsGetter.INSTANCE, locale);
if (providersInstance != null) {
return providersInstance;
}
}
return new DecimalFormatSymbols(locale);
}
Gets the DecimalFormatSymbols instance for the specified
locale. This method provides access to DecimalFormatSymbols
instances for locales supported by the Java runtime itself as well
as for those supported by installed
DecimalFormatSymbolsProvider implementations. |
public String getInternationalCurrencySymbol() {
return intlCurrencySymbol;
}
Returns the ISO 4217 currency code of the currency of these
DecimalFormatSymbols. |
public char getMinusSign() {
return minusSign;
}
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. |
public char getMonetaryDecimalSeparator() {
return monetarySeparator;
}
Returns the monetary decimal separator. |
public String getNaN() {
return NaN;
}
Gets the string used to represent "not a number". Almost always left
unchanged. |
public char getPatternSeparator() {
return patternSeparator;
}
Gets the character used to separate positive and negative subpatterns
in a pattern. |
public char getPerMill() {
return perMill;
}
Gets the character used for per mille sign. Different for Arabic, etc. |
public char getPercent() {
return percent;
}
Gets the character used for percent sign. Different for Arabic, etc. |
public char getZeroDigit() {
return zeroDigit;
}
Gets the character used for zero. Different for Arabic, etc. |
public int hashCode() {
int result = zeroDigit;
result = result * 37 + groupingSeparator;
result = result * 37 + decimalSeparator;
return result;
}
|
public void setCurrency(Currency currency) {
if (currency == null) {
throw new NullPointerException();
}
this.currency = currency;
intlCurrencySymbol = currency.getCurrencyCode();
currencySymbol = currency.getSymbol(locale);
}
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. |
public void setCurrencySymbol(String currency) {
currencySymbol = currency;
}
Sets the currency symbol for the currency of these
DecimalFormatSymbols in their locale. |
public void setDecimalSeparator(char decimalSeparator) {
this.decimalSeparator = decimalSeparator;
}
Sets the character used for decimal sign. Different for French, etc. |
public void setDigit(char digit) {
this.digit = digit;
}
Sets the character used for a digit in a pattern. |
public void setExponentSeparator(String exp) {
if (exp == null) {
throw new NullPointerException();
}
exponentialSeparator = exp;
}
Sets the string used to separate the mantissa from the exponent.
Examples: "x10^" for 1.23x10^4, "E" for 1.23E4. |
void setExponentialSymbol(char exp) {
exponential = exp;
}
Sets the character used to separate the mantissa from the exponent. |
public void setGroupingSeparator(char groupingSeparator) {
this.groupingSeparator = groupingSeparator;
}
Sets the character used for thousands separator. Different for French, etc. |
public void setInfinity(String infinity) {
this.infinity = infinity;
}
Sets the string used to represent infinity. Almost always left
unchanged. |
public void setInternationalCurrencySymbol(String currencyCode) {
intlCurrencySymbol = currencyCode;
currency = null;
if (currencyCode != null) {
try {
currency = Currency.getInstance(currencyCode);
currencySymbol = currency.getSymbol();
} catch (IllegalArgumentException e) {
}
}
}
Sets the ISO 4217 currency code of the currency of these
DecimalFormatSymbols.
If the currency code is valid (as defined by
Currency.getInstance ),
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. |
public void setMinusSign(char minusSign) {
this.minusSign = 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. |
public void setMonetaryDecimalSeparator(char sep) {
monetarySeparator = sep;
}
Sets the monetary decimal separator. |
public void setNaN(String NaN) {
this.NaN = NaN;
}
Sets the string used to represent "not a number". Almost always left
unchanged. |
public void setPatternSeparator(char patternSeparator) {
this.patternSeparator = patternSeparator;
}
Sets the character used to separate positive and negative subpatterns
in a pattern. |
public void setPerMill(char perMill) {
this.perMill = perMill;
}
Sets the character used for per mille sign. Different for Arabic, etc. |
public void setPercent(char percent) {
this.percent = percent;
}
Sets the character used for percent sign. Different for Arabic, etc. |
public void setZeroDigit(char zeroDigit) {
this.zeroDigit = zeroDigit;
}
Sets the character used for zero. Different for Arabic, etc. |