DecimalFormatSymbols
public
class
DecimalFormatSymbols
extends Object
implements
Cloneable,
Serializable
java.lang.Object | |
↳ | android.icu.text.DecimalFormatSymbols |
[icu enhancement] ICU's replacement for DecimalFormatSymbols
. Methods, fields, and other functionality specific to ICU are labeled '[icu]'.
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:
Summary
Constants | |
---|---|
int |
CURRENCY_SPC_CURRENCY_MATCH
[icu] Indicates the currency match pattern used in |
int |
CURRENCY_SPC_INSERT
[icu] Indicates the insertion value used in |
int |
CURRENCY_SPC_SURROUNDING_MATCH
[icu] Indicates the surrounding match pattern used in |
Public constructors | |
---|---|
DecimalFormatSymbols()
Creates a DecimalFormatSymbols object for the default |
|
DecimalFormatSymbols(Locale locale)
Creates a DecimalFormatSymbols object for the given locale. |
|
DecimalFormatSymbols(ULocale locale)
[icu] Creates a DecimalFormatSymbols object for the given locale. |
Public methods | |
---|---|
Object
|
clone()
Creates and returns a copy of this object. |
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
static
DecimalFormatSymbols
|
forNumberingSystem(ULocale locale, NumberingSystem ns)
[icu] Returns a DecimalFormatSymbols instance for the given locale with digits and symbols
corresponding to the given |
static
DecimalFormatSymbols
|
forNumberingSystem(Locale locale, NumberingSystem ns)
[icu] Returns a DecimalFormatSymbols instance for the given locale with digits and symbols
corresponding to the given |
static
Locale[]
|
getAvailableLocales()
Returns an array of all locales for which the |
static
ULocale[]
|
getAvailableULocales()
[icu] Returns an array of all locales for which the |
Currency
|
getCurrency()
Returns the currency symbol, for |
String
|
getCurrencySymbol()
Returns the string denoting the local currency. |
char
|
getDecimalSeparator()
Returns the character used for decimal sign. |
String
|
getDecimalSeparatorString()
[icu] Returns the string used for decimal sign. |
char
|
getDigit()
Returns the character used for a digit in a pattern. |
String[]
|
getDigitStrings()
[icu] Returns the array of strings used as digits, in order from 0 through 9 |
char[]
|
getDigits()
Returns the array of characters used as digits, in order from 0 through 9 |
String
|
getExponentMultiplicationSign()
Returns the multiplication sign |
String
|
getExponentSeparator()
[icu] Returns the string used to separate the mantissa from the exponent. |
char
|
getGroupingSeparator()
Returns the character used for grouping separator. |
String
|
getGroupingSeparatorString()
[icu] Returns the string used for grouping separator. |
String
|
getInfinity()
Returns the String used to represent infinity. |
static
DecimalFormatSymbols
|
getInstance()
Returns a DecimalFormatSymbols instance for the default locale. |
static
DecimalFormatSymbols
|
getInstance(Locale locale)
Returns a DecimalFormatSymbols instance for the given locale. |
static
DecimalFormatSymbols
|
getInstance(ULocale locale)
Returns a DecimalFormatSymbols instance for the given locale. |
String
|
getInternationalCurrencySymbol()
Returns the international string denoting the local currency. |
Locale
|
getLocale()
Returns the locale for which this object was constructed. |
char
|
getMinusSign()
Returns the character used to represent minus sign. |
String
|
getMinusSignString()
[icu] Returns the string used to represent minus sign. |
char
|
getMonetaryDecimalSeparator()
Returns the monetary decimal separator. |
String
|
getMonetaryDecimalSeparatorString()
[icu] Returns the monetary decimal separator string. |
char
|
getMonetaryGroupingSeparator()
[icu] Returns the monetary grouping separator. |
String
|
getMonetaryGroupingSeparatorString()
[icu] Returns the monetary grouping separator. |
String
|
getNaN()
Returns the String used to represent NaN. |
char
|
getPadEscape()
[icu] Returns the character used to pad numbers out to a specified width. |
String
|
getPatternForCurrencySpacing(int itemType, boolean beforeCurrency)
[icu] Returns the desired currency spacing value. |
char
|
getPatternSeparator()
Returns the character used to separate positive and negative subpatterns in a pattern. |
char
|
getPerMill()
Returns the character used for mille percent sign. |
String
|
getPerMillString()
[icu] Returns the string used for permille sign. |
char
|
getPercent()
Returns the character used for percent sign. |
String
|
getPercentString()
[icu] Returns the string used for percent sign. |
char
|
getPlusSign()
[icu] Returns the localized plus sign. |
String
|
getPlusSignString()
[icu] Returns the string used to represent plus sign. |
char
|
getSignificantDigit()
Returns the character used to represent a significant digit in a pattern. |
ULocale
|
getULocale()
Returns the locale for which this object was constructed. |
char
|
getZeroDigit()
Returns the character used for zero. |
int
|
hashCode()
Returns a hash code value for the object. |
void
|
setCurrency(Currency currency)
Sets the currency. |
void
|
setCurrencySymbol(String currency)
Sets the string denoting the local currency. |
void
|
setDecimalSeparator(char decimalSeparator)
Sets the character used for decimal sign. |
void
|
setDecimalSeparatorString(String decimalSeparatorString)
[icu] Sets the string used for decimal sign. |
void
|
setDigit(char digit)
Sets the character used for a digit in a pattern. |
void
|
setDigitStrings(String[] digitStrings)
[icu] Sets the array of strings used as digits, in order from 0 through 9 Note:
When the input array of digit strings contains any strings
represented by multiple Java chars, then |
void
|
setExponentMultiplicationSign(String exponentMultiplicationSign)
Sets the multiplication sign |
void
|
setExponentSeparator(String exp)
[icu] Sets the string used to separate the mantissa from the exponent. |
void
|
setGroupingSeparator(char groupingSeparator)
Sets the character used for grouping separator. |
void
|
setGroupingSeparatorString(String groupingSeparatorString)
[icu] Sets the string used for grouping separator. |
void
|
setInfinity(String infinity)
Sets the String used to represent infinity. |
void
|
setInternationalCurrencySymbol(String currency)
Sets the international string denoting the local currency. |
void
|
setMinusSign(char minusSign)
Sets the character used to represent minus sign. |
void
|
setMinusSignString(String minusSignString)
[icu] Sets the string used to represent minus sign. |
void
|
setMonetaryDecimalSeparator(char sep)
Sets the monetary decimal separator. |
void
|
setMonetaryDecimalSeparatorString(String sep)
[icu] Sets the monetary decimal separator string. |
void
|
setMonetaryGroupingSeparator(char sep)
[icu] Sets the monetary grouping separator. |
void
|
setMonetaryGroupingSeparatorString(String sep)
[icu] Sets the monetary grouping separator string. |
void
|
setNaN(String NaN)
Sets the String used to represent NaN. |
void
|
setPadEscape(char c)
[icu] Sets the character used to pad numbers out to a specified width. |
void
|
setPatternForCurrencySpacing(int itemType, boolean beforeCurrency, String pattern)
[icu] Sets the indicated currency spacing pattern or value. |
void
|
setPatternSeparator(char patternSeparator)
Sets the character used to separate positive and negative subpatterns in a pattern. |
void
|
setPerMill(char perMill)
Sets the character used for mille percent sign. |
void
|
setPerMillString(String perMillString)
[icu] Sets the string used for permille sign. |
void
|
setPercent(char percent)
Sets the character used for percent sign. |
void
|
setPercentString(String percentString)
[icu] Sets the string used for percent sign. |
void
|
setPlusSign(char plus)
[icu] Sets the localized plus sign. |
void
|
setPlusSignString(String plusSignString)
[icu] Sets the localized plus sign string. |
void
|
setSignificantDigit(char sigDigit)
Sets the character used to represent a significant digit in a pattern. |
void
|
setZeroDigit(char zeroDigit)
Sets the character used for zero. |
Inherited methods | |
---|---|
Constants
CURRENCY_SPC_CURRENCY_MATCH
public static final int CURRENCY_SPC_CURRENCY_MATCH
[icu] Indicates the currency match pattern used in getPatternForCurrencySpacing(int, boolean)
.
Constant Value: 0 (0x00000000)
CURRENCY_SPC_INSERT
public static final int CURRENCY_SPC_INSERT
[icu] Indicates the insertion value used in getPatternForCurrencySpacing(int, boolean)
.
Constant Value: 2 (0x00000002)
CURRENCY_SPC_SURROUNDING_MATCH
public static final int CURRENCY_SPC_SURROUNDING_MATCH
[icu] Indicates the surrounding match pattern used in getPatternForCurrencySpacing(int, boolean)
.
Constant Value: 1 (0x00000001)
Public constructors
DecimalFormatSymbols
public DecimalFormatSymbols ()
Creates a DecimalFormatSymbols object for the default FORMAT
locale.
See also:
DecimalFormatSymbols
public DecimalFormatSymbols (Locale locale)
Creates a DecimalFormatSymbols object for the given locale.
Parameters | |
---|---|
locale |
Locale : the locale |
DecimalFormatSymbols
public DecimalFormatSymbols (ULocale locale)
[icu] Creates a DecimalFormatSymbols object for the given locale.
Parameters | |
---|---|
locale |
ULocale : the locale |
Public methods
clone
public Object clone ()
Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object x
, the expression:
will be true, and that the expression:x.clone() != x
will bex.clone().getClass() == x.getClass()
true
, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x)
true
, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
super.clone
. If a class and all of its superclasses (except
Object
) obey this convention, it will be the case that
x.clone().getClass() == x.getClass()
.
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by super.clone
before returning it. Typically, this means
copying any mutable objects that comprise the internal "deep structure"
of the object being cloned and replacing the references to these
objects with references to the copies. If a class contains only
primitive fields or references to immutable objects, then it is usually
the case that no fields in the object returned by super.clone
need to be modified.
Returns | |
---|---|
Object |
a clone of this instance. |
equals
public boolean equals (Object obj)
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation
on non-null object references:
- It is reflexive: for any non-null reference value
x
,x.equals(x)
should returntrue
. - It is symmetric: for any non-null reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified. - For any non-null reference value
x
,x.equals(null)
should returnfalse
.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
Parameters | |
---|---|
obj |
Object : the reference object with which to compare. |
Returns | |
---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
forNumberingSystem
public static DecimalFormatSymbols forNumberingSystem (ULocale locale, NumberingSystem ns)
[icu] Returns a DecimalFormatSymbols instance for the given locale with digits and symbols
corresponding to the given NumberingSystem
.
This method behaves equivalently to getInstance()
called with a locale having a
"numbers=xxxx" keyword specifying the numbering system by name.
In this method, the NumberingSystem argument will be used even if the locale has its own "numbers=xxxx" keyword.
Parameters | |
---|---|
locale |
ULocale : the locale. |
ns |
NumberingSystem : the numbering system. |
Returns | |
---|---|
DecimalFormatSymbols |
A DecimalFormatSymbols instance. |
forNumberingSystem
public static DecimalFormatSymbols forNumberingSystem (Locale locale, NumberingSystem ns)
[icu] Returns a DecimalFormatSymbols instance for the given locale with digits and symbols
corresponding to the given NumberingSystem
.
This method behaves equivalently to getInstance()
called with a locale having a
"numbers=xxxx" keyword specifying the numbering system by name.
In this method, the NumberingSystem argument will be used even if the locale has its own "numbers=xxxx" keyword.
Parameters | |
---|---|
locale |
Locale : the locale. |
ns |
NumberingSystem : the numbering system. |
Returns | |
---|---|
DecimalFormatSymbols |
A DecimalFormatSymbols instance. |
getAvailableLocales
public static Locale[] getAvailableLocales ()
Returns an array of all locales for which the getInstance
methods of
this class can return localized instances.
Note: Unlike
java.text.DecimalFormatSymbols#getAvailableLocales
, this method simply
returns the array of Locale
s available for this class. ICU currently
does not support DecimalFormatSymbolsProvider
, which was introduced in
Java 6.
Returns | |
---|---|
Locale[] |
An array of Locale s for which localized
DecimalFormatSymbols instances are available. |
getAvailableULocales
public static ULocale[] getAvailableULocales ()
[icu] Returns an array of all locales for which the getInstance
methods of this class can return localized instances.
Note: Unlike
java.text.DecimalFormatSymbols#getAvailableLocales
, this method simply
returns the array of ULocale
s available in this class. ICU currently
does not support DecimalFormatSymbolsProvider
, which was introduced in
Java 6.
Returns | |
---|---|
ULocale[] |
An array of ULocale s for which localized
DecimalFormatSymbols instances are available. |
getCurrency
public Currency getCurrency ()
Returns the currency symbol, for DecimalFormatSymbols#getCurrency()
API
compatibility only. ICU clients should use the Currency API directly.
Returns | |
---|---|
Currency |
the currency used, or null |
getCurrencySymbol
public String getCurrencySymbol ()
Returns the string denoting the local currency.
Returns | |
---|---|
String |
the local currency String. |
getDecimalSeparator
public char getDecimalSeparator ()
Returns the character used for decimal sign. Different for French, etc.
API Note:
- Discouraged: ICU 58 use
getDecimalSeparatorString()
instead.
Returns | |
---|---|
char |
the decimal character |
getDecimalSeparatorString
public String getDecimalSeparatorString ()
[icu] Returns the string used for decimal sign.
Returns | |
---|---|
String |
the decimal sign string |
See also:
getDigit
public char getDigit ()
Returns the character used for a digit in a pattern.
Returns | |
---|---|
char |
the digit pattern character |
getDigitStrings
public String[] getDigitStrings ()
[icu] Returns the array of strings used as digits, in order from 0 through 9
Returns | |
---|---|
String[] |
The array of ten digit strings |
See also:
getDigits
public char[] getDigits ()
Returns the array of characters used as digits, in order from 0 through 9
API Note:
- Discouraged: ICU 58 use
getDigitStrings()
instead.
Returns | |
---|---|
char[] |
The array |
See also:
getExponentMultiplicationSign
public String getExponentMultiplicationSign ()
Returns the multiplication sign
Returns | |
---|---|
String |
getExponentSeparator
public String getExponentSeparator ()
[icu] Returns the string used to separate the mantissa from the exponent. Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.
Returns | |
---|---|
String |
the localized exponent symbol, used in localized patterns and formatted strings |
See also:
getGroupingSeparator
public char getGroupingSeparator ()
Returns the character used for grouping separator. Different for French, etc.
API Note:
- Discouraged: ICU 58 use
getGroupingSeparatorString()
instead.
Returns | |
---|---|
char |
the thousands character |
getGroupingSeparatorString
public String getGroupingSeparatorString ()
[icu] Returns the string used for grouping separator. Different for French, etc.
Returns | |
---|---|
String |
the grouping separator string |
See also:
getInfinity
public String getInfinity ()
Returns the String used to represent infinity. Almost always left unchanged.
Returns | |
---|---|
String |
the Infinity string |
getInstance
public static DecimalFormatSymbols getInstance ()
Returns a DecimalFormatSymbols instance for the default locale.
Note: Unlike
java.text.DecimalFormatSymbols#getInstance
, this method simply returns
new android.icu.text.DecimalFormatSymbols()
. ICU currently does not
support DecimalFormatSymbolsProvider
, which was introduced in Java 6.
Returns | |
---|---|
DecimalFormatSymbols |
A DecimalFormatSymbols instance. |
getInstance
public static DecimalFormatSymbols getInstance (Locale locale)
Returns a DecimalFormatSymbols instance for the given locale.
Note: Unlike
java.text.DecimalFormatSymbols#getInstance
, this method simply returns
new android.icu.text.DecimalFormatSymbols(locale)
. ICU currently does
not support DecimalFormatSymbolsProvider
, which was introduced in Java
6.
Parameters | |
---|---|
locale |
Locale : the locale. |
Returns | |
---|---|
DecimalFormatSymbols |
A DecimalFormatSymbols instance. |
getInstance
public static DecimalFormatSymbols getInstance (ULocale locale)
Returns a DecimalFormatSymbols instance for the given locale.
Note: Unlike
java.text.DecimalFormatSymbols#getInstance
, this method simply returns
new android.icu.text.DecimalFormatSymbols(locale)
. ICU currently does
not support DecimalFormatSymbolsProvider
, which was introduced in Java
6.
Parameters | |
---|---|
locale |
ULocale : the locale. |
Returns | |
---|---|
DecimalFormatSymbols |
A DecimalFormatSymbols instance. |
getInternationalCurrencySymbol
public String getInternationalCurrencySymbol ()
Returns the international string denoting the local currency.
Returns | |
---|---|
String |
the international string denoting the local currency |
getLocale
public Locale getLocale ()
Returns the locale for which this object was constructed.
Returns | |
---|---|
Locale |
the locale for which this object was constructed |
getMinusSign
public char getMinusSign ()
Returns the character used to represent minus sign. If no explicit negative format is specified, one is formed by prefixing minusSign to the positive format.
API Note:
- Discouraged: ICU 58 use
getMinusSignString()
instead.
Returns | |
---|---|
char |
the minus sign character |
getMinusSignString
public String getMinusSignString ()
[icu] Returns the string used to represent minus sign.
Returns | |
---|---|
String |
the minus sign string |
See also:
getMonetaryDecimalSeparator
public char getMonetaryDecimalSeparator ()
Returns the monetary decimal separator.
API Note:
- Discouraged: ICU 58 use
getMonetaryDecimalSeparatorString()
instead.
Returns | |
---|---|
char |
the monetary decimal separator character |
getMonetaryDecimalSeparatorString
public String getMonetaryDecimalSeparatorString ()
[icu] Returns the monetary decimal separator string.
Returns | |
---|---|
String |
the monetary decimal separator string |
getMonetaryGroupingSeparator
public char getMonetaryGroupingSeparator ()
[icu] Returns the monetary grouping separator.
API Note:
- Discouraged: ICU 58 use
getMonetaryGroupingSeparatorString()
instead.
Returns | |
---|---|
char |
the monetary grouping separator character |
getMonetaryGroupingSeparatorString
public String getMonetaryGroupingSeparatorString ()
[icu] Returns the monetary grouping separator.
Returns | |
---|---|
String |
the monetary grouping separator string |
getNaN
public String getNaN ()
Returns the String used to represent NaN. Almost always left unchanged.
Returns | |
---|---|
String |
the NaN String |
getPadEscape
public char getPadEscape ()
[icu] Returns 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 | |
---|---|
char |
the character |
getPatternForCurrencySpacing
public String getPatternForCurrencySpacing (int itemType, boolean beforeCurrency)
[icu] Returns the desired currency spacing value. Original values come from ICU's CLDR data based on the locale provided during construction, and can be null. These values govern what and when text is inserted between a currency code/name/symbol and the currency amount when formatting money.
For more information, see UTS#35 section 5.10.2.
Parameters | |
---|---|
itemType |
int : one of CURRENCY_SPC_CURRENCY_MATCH, CURRENCY_SPC_SURROUNDING_MATCH
or CURRENCY_SPC_INSERT |
beforeCurrency |
boolean : true to get the beforeCurrency values, false
to get the afterCurrency values. |
Returns | |
---|---|
String |
the value, or null. |
getPatternSeparator
public char getPatternSeparator ()
Returns the character used to separate positive and negative subpatterns in a pattern.
Returns | |
---|---|
char |
the pattern separator character |
getPerMill
public char getPerMill ()
Returns the character used for mille percent sign. Different for Arabic, etc.
API Note:
- Discouraged: ICU 58 use
getPerMillString()
instead.
Returns | |
---|---|
char |
the mille percent character |
getPerMillString
public String getPerMillString ()
[icu] Returns the string used for permille sign.
Returns | |
---|---|
String |
the permille string |
See also:
getPercent
public char getPercent ()
Returns the character used for percent sign. Different for Arabic, etc.
API Note:
- Discouraged: ICU 58 use
getPercentString()
instead.
Returns | |
---|---|
char |
the percent character |
getPercentString
public String getPercentString ()
[icu] Returns the string used for percent sign.
Returns | |
---|---|
String |
the percent string |
See also:
getPlusSign
public char getPlusSign ()
[icu] Returns the localized plus sign.
API Note:
- Discouraged: ICU 58 use
getPlusSignString()
instead.
Returns | |
---|---|
char |
the plus sign, used in localized patterns and formatted strings |
getPlusSignString
public String getPlusSignString ()
[icu] Returns the string used to represent plus sign.
Returns | |
---|---|
String |
the plus sign string |
getSignificantDigit
public char getSignificantDigit ()
Returns the character used to represent a significant digit in a pattern.
Returns | |
---|---|
char |
the significant digit pattern character |
getULocale
public ULocale getULocale ()
Returns the locale for which this object was constructed.
Returns | |
---|---|
ULocale |
the locale for which this object was constructed |
getZeroDigit
public char getZeroDigit ()
Returns the character used for zero. Different for Arabic, etc.
API Note:
- Discouraged: ICU 58 use
getDigitStrings()
instead.
Returns | |
---|---|
char |
the character |
hashCode
public int hashCode ()
Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
HashMap
.
The general contract of hashCode
is:
- Whenever it is invoked on the same object more than once during
an execution of a Java application, the
hashCode
method must consistently return the same integer, provided no information used inequals
comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. - If two objects are equal according to the
equals
method, then calling thehashCode
method on each of the two objects must produce the same integer result. - It is not required that if two objects are unequal
according to the
equals
method, then calling thehashCode
method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns | |
---|---|
int |
a hash code value for this object. |
setCurrency
public void setCurrency (Currency currency)
Sets the currency.
Note: ICU does not use the DecimalFormatSymbols for the currency any more. This API is present for API compatibility only.
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 |
Currency : the new currency to be used |
Throws | |
---|---|
NullPointerException |
if currency is null |
setCurrencySymbol
public void setCurrencySymbol (String currency)
Sets the string denoting the local currency.
Parameters | |
---|---|
currency |
String : the local currency String. |
setDecimalSeparator
public void setDecimalSeparator (char decimalSeparator)
Sets the character used for decimal sign. Different for French, etc.
Parameters | |
---|---|
decimalSeparator |
char : the decimal character |
setDecimalSeparatorString
public void setDecimalSeparatorString (String decimalSeparatorString)
[icu] Sets the string used for decimal sign.
Note: When the input decimal separator String is represented
by multiple Java chars, then getDecimalSeparator()
will
return the default decimal separator character ('.').
Parameters | |
---|---|
decimalSeparatorString |
String : the decimal sign string |
Throws | |
---|---|
NullPointerException |
if decimalSeparatorString is null. |
See also:
setDigit
public void setDigit (char digit)
Sets the character used for a digit in a pattern.
Parameters | |
---|---|
digit |
char : the digit pattern character |
setDigitStrings
public void setDigitStrings (String[] digitStrings)
[icu] Sets the array of strings used as digits, in order from 0 through 9
Note:
When the input array of digit strings contains any strings
represented by multiple Java chars, then getDigits()
will return
the default digits ('0' - '9') and getZeroDigit()
will return the
default zero digit ('0').
Parameters | |
---|---|
digitStrings |
String : The array of digit strings. The length of the array must be exactly 10. |
Throws | |
---|---|
NullPointerException |
if the digitStrings is null. |
IllegalArgumentException |
if the length of the array is not 10. |
See also:
setExponentMultiplicationSign
public void setExponentMultiplicationSign (String exponentMultiplicationSign)
Sets the multiplication sign
Parameters | |
---|---|
exponentMultiplicationSign |
String |
setExponentSeparator
public void setExponentSeparator (String exp)
[icu] Sets the string used to separate the mantissa from the exponent. Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.
Parameters | |
---|---|
exp |
String : the localized exponent symbol, used in localized patterns
and formatted strings |
See also:
setGroupingSeparator
public void setGroupingSeparator (char groupingSeparator)
Sets the character used for grouping separator. Different for French, etc.
Parameters | |
---|---|
groupingSeparator |
char : the thousands character |
See also:
setGroupingSeparatorString
public void setGroupingSeparatorString (String groupingSeparatorString)
[icu] Sets the string used for grouping separator.
Note: When the input grouping separator String is represented
by multiple Java chars, then getGroupingSeparator()
will
return the default grouping separator character (',').
Parameters | |
---|---|
groupingSeparatorString |
String : the grouping separator string |
Throws | |
---|---|
NullPointerException |
if groupingSeparatorString is null. |
See also:
setInfinity
public void setInfinity (String infinity)
Sets the String used to represent infinity. Almost always left unchanged.
Parameters | |
---|---|
infinity |
String : the Infinity String |
setInternationalCurrencySymbol
public void setInternationalCurrencySymbol (String currency)
Sets the international string denoting the local currency.
Parameters | |
---|---|
currency |
String : the international string denoting the local currency. |
setMinusSign
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.
Parameters | |
---|---|
minusSign |
char : the minus sign character |
setMinusSignString
public void setMinusSignString (String minusSignString)
[icu] Sets the string used to represent minus sign.
Note: When the input minus sign String is represented
by multiple Java chars, then getMinusSign()
will
return the default minus sign character ('-').
Parameters | |
---|---|
minusSignString |
String : the minus sign string |
Throws | |
---|---|
NullPointerException |
if minusSignString is null. |
See also:
setMonetaryDecimalSeparator
public void setMonetaryDecimalSeparator (char sep)
Sets the monetary decimal separator.
Parameters | |
---|---|
sep |
char : the monetary decimal separator character |
setMonetaryDecimalSeparatorString
public void setMonetaryDecimalSeparatorString (String sep)
[icu] Sets the monetary decimal separator string.
Note: When the input monetary decimal separator String is represented
by multiple Java chars, then getMonetaryDecimalSeparatorString()
will
return the default monetary decimal separator character ('.').
Parameters | |
---|---|
sep |
String : the monetary decimal separator string |
Throws | |
---|---|
NullPointerException |
if sep is null. |
See also:
setMonetaryGroupingSeparator
public void setMonetaryGroupingSeparator (char sep)
[icu] Sets the monetary grouping separator.
Parameters | |
---|---|
sep |
char : the monetary grouping separator character |
setMonetaryGroupingSeparatorString
public void setMonetaryGroupingSeparatorString (String sep)
[icu] Sets the monetary grouping separator string.
Note: When the input grouping separator String is represented
by multiple Java chars, then getMonetaryGroupingSeparator()
will
return the default monetary grouping separator character (',').
Parameters | |
---|---|
sep |
String : the monetary grouping separator string |
Throws | |
---|---|
NullPointerException |
if sep is null. |
See also:
setNaN
public void setNaN (String NaN)
Sets the String used to represent NaN. Almost always left unchanged.
Parameters | |
---|---|
NaN |
String : the NaN String |
setPadEscape
public void setPadEscape (char c)
[icu] Sets 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.
Parameters | |
---|---|
c |
char |
setPatternForCurrencySpacing
public void setPatternForCurrencySpacing (int itemType, boolean beforeCurrency, String pattern)
[icu] Sets the indicated currency spacing pattern or value. See getPatternForCurrencySpacing(int, boolean)
for more information.
Values for currency match and surrounding match must be UnicodeSet
patterns. Values for insert can be any string.
Note: ICU4J does not currently use this information.
Parameters | |
---|---|
itemType |
int : one of CURRENCY_SPC_CURRENCY_MATCH, CURRENCY_SPC_SURROUNDING_MATCH
or CURRENCY_SPC_INSERT |
beforeCurrency |
boolean : true if the pattern is for before the currency symbol.
false if the pattern is for after it. |
pattern |
String : string to override current setting; can be null. |
setPatternSeparator
public void setPatternSeparator (char patternSeparator)
Sets the character used to separate positive and negative subpatterns in a pattern.
Parameters | |
---|---|
patternSeparator |
char : the pattern separator character |
setPerMill
public void setPerMill (char perMill)
Sets the character used for mille percent sign. Different for Arabic, etc.
Parameters | |
---|---|
perMill |
char : the mille percent character |
setPerMillString
public void setPerMillString (String perMillString)
[icu] Sets the string used for permille sign.
Note: When the input permille String is represented
by multiple Java chars, then getPerMill()
will
return the default permille character ('‰').
Parameters | |
---|---|
perMillString |
String : the permille string |
Throws | |
---|---|
NullPointerException |
if perMillString is null. |
See also:
setPercent
public void setPercent (char percent)
Sets the character used for percent sign. Different for Arabic, etc.
Parameters | |
---|---|
percent |
char : the percent character |
setPercentString
public void setPercentString (String percentString)
[icu] Sets the string used for percent sign.
Note: When the input grouping separator String is represented
by multiple Java chars, then getPercent()
will
return the default percent sign character ('%').
Parameters | |
---|---|
percentString |
String : the percent string |
Throws | |
---|---|
NullPointerException |
if percentString is null. |
See also:
setPlusSign
public void setPlusSign (char plus)
[icu] Sets the localized plus sign.
Parameters | |
---|---|
plus |
char : the plus sign, used in localized patterns and formatted
strings |
setPlusSignString
public void setPlusSignString (String plusSignString)
[icu] Sets the localized plus sign string.
Note: When the input plus sign String is represented
by multiple Java chars, then getPlusSign()
will
return the default plus sign character ('+').
Parameters | |
---|---|
plusSignString |
String : the plus sign string, used in localized patterns and formatted
strings |
Throws | |
---|---|
NullPointerException |
if plusSignString is null. |
See also:
setSignificantDigit
public void setSignificantDigit (char sigDigit)
Sets the character used to represent a significant digit in a pattern.
Parameters | |
---|---|
sigDigit |
char : the significant digit pattern character |
setZeroDigit
public void setZeroDigit (char zeroDigit)
Sets the character used for zero.
Note: This method propagates digit 1 to digit 9 by incrementing code point one by one.
API Note:
- Discouraged: ICU 58 use
setDigitStrings(java.lang.String[])
instead.
Parameters | |
---|---|
zeroDigit |
char : the zero character. |