|
Chapter 16 The java.text Package |
|
DecimalFormatSymbols
Name
DecimalFormatSymbols
- Class Name:
-
java.text.DecimalFormatSymbols
- Superclass:
-
java.lang.Object
- Immediate Subclasses:
-
None
- Interfaces Implemented:
-
java.lang.Cloneable,
java.io.Serializable
- Availability:
-
New as of JDK 1.1
The DecimalFormatSymbols class
encapsulates number-formatting data that is locale-specific, like grouping
separators and decimal separators. Typically, you do not need to instantiate
DecimalFormatSymbols yourself.
Instead, an instance is automatically created for you, behind the scenes,
when you use one of the factory methods in NumberFormat
to create a DecimalFormat object.
You can retrieve a DecimalFormatSymbols
object by calling the getDecimalFormatSymbols()
method of DecimalFormat. Once
you have a DecimalFormatSymbols
object, you can modify the strings it uses if you want to change them.
public final class java.text.DecimalFormatSymbols extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable {
// Constructors
public DecimalFormatSymbols();
public DecimalFormatSymbols(Locale locale);
// Instance Methods
public Object clone();
public boolean equals(Object obj);
public char getDecimalSeparator();
public char getDigit();
public char getGroupingSeparator();
public String getInfinity();
public char getMinusSign();
public String getNaN();
public char getPatternSeparator();
public char getPerMill();
public char getPercent();
public char getZeroDigit();
public int hashCode();
public void setDecimalSeparator(char decimalSeparator);
public void setDigit(char digit);
public void setGroupingSeparator(char groupingSeparator);
public void setInfinity(String infinity);
public void setMinusSign(char minusSign);
public void setNaN(String NaN);
public void setPatternSeparator(char patternSeparator);
public void setPerMill(char perMill);
public void setPercent(char percent);
public void setZeroDigit(char zeroDigit);
}
- Description
-
This constructor creates a DecimalFormatSymbols
object for the default locale.
- Parameters
-
- locale
-
The Locale to use.
- Description
-
This constructor creates a DecimalFormatSymbols
object for the given locale.
- Returns
-
A copy of this DecimalFormatSymbols.
- Overrides
-
Object.clone()
- Description
-
This method creates a copy of this DecimalFormatSymbols
and returns it.
- Parameters
-
- obj
-
The object to be compared with this object.
- Returns
-
true if the objects are equal;
false if they are not.
- Overrides
-
Object.equals()
- Description
-
This method returns true if
obj is an instance of DateFormatSymbols
and is equivalent to this DecimalFormatSymbols.
- Returns
-
The character used to separate the integer and
fractional parts of a number for this DecimalFormatSymbols.
- Description
-
This method returns the decimal separator character (e.g., ".",
",").
- Returns
-
The character used to represent a digit in a
pattern string for this DecimalFormatSymbols.
- Description
-
This method returns the digit pattern character, which represents a digit
that is not shown if it is zero.
- Returns
-
The character used to separate long numbers for
this DecimalFormatSymbols.
- Description
-
This method returns the grouping separator character (e.g., ",",
".").
- Returns
-
The string used to represent infinity for this
DecimalFormatSymbols.
- Description
-
This method returns the string that represents infinity.
- Returns
-
The character used to signify negative numbers
for this DecimalFormatSymbols.
- Description
-
This method returns the character that signifies negative numbers.
- Returns
-
The string used to represent the value not-a-number
for this DecimalFormatSymbols.
- Description
-
This method returns the string that represents not-a-number.
- Returns
-
The pattern separator character for this DecimalFormatSymbols.
- Description
-
This method returns the character used in pattern strings to separate
the positive subpattern and negative subpattern.
- Returns
-
The character used to represent the per mille sign
for this DecimalFormatSymbols.
- Description
-
This method returns the character that represents a per mille value.
- Returns
-
The character used to represent the percent sign
for this DecimalFormatSymbols.
- Description
-
This method returns the character that represents a percent value
(e.g., %).
- Returns
-
The character used to represent a digit in a
pattern string for this DecimalFormatSymbols.
- Description
-
This method returns the zero-digit pattern character, which represents
a digit that is shown even if it is zero.
- Returns
-
A hashcode for this object.
- Overrides
-
Object.hashCode()
- Description
-
This method returns a hashcode for this DecimalFormatSymbols
object.
- Parameters
-
- decimalSeparator
-
The new decimal separator.
- Description
-
This method sets the decimal separator character for this DecimalFormatSymbols.
- Parameters
-
- digit
-
The new digit pattern character.
- Description
-
This method sets the digit pattern character, which represents a digit
that is not shown if it is zero, for this DecimalFormatSymbols.
- Parameters
-
- groupingSeparator
-
The new grouping separator.
- Description
-
This method sets the grouping separator character for this DecimalFormatSymbols.
- Parameters
-
- infinity
-
The new infinity string.
- Description
-
This method sets the string that represents infinity for this
DecimalFormatSymbols.
- Parameters
-
- minusSign
-
The new minus sign.
- Description
-
This method sets the character that signifies negative numbers
for this DecimalFormatSymbols.
- Parameters
-
- NaN
-
The new non-a-number string.
- Description
-
This method sets the string that represents not-a-number for
this DecimalFormatSymbols.
- Parameters
-
- patternSeparator
-
The new pattern separator.
- Description
-
This method sets the character that is used in pattern strings to separate
the positive subpattern and negative subpattern for this DecimalFormatSymbols.
- Parameters
-
- perMill
-
The new per mille sign.
- Description
-
This method sets the character that represents the per mille sign
for this DecimalFormatSymbols.
- Parameters
-
- percent
-
The new percent sign.
- Description
-
This method sets the character that represents the percent sign
for this DecimalFormatSymbols.
- Parameters
-
- zeroDigit
-
The new zero-digit pattern character.
- Description
-
This method sets the zero-digit pattern character, which represents a digit
that is shown even if it is zero, for this DecimalFormatSymbols.
DecimalFormat,
NumberFormat,
Locale
|