📄 changes
字号:
____________
TEXT CHANGES - DateFormatData
Renamed class to DateFormatSymbols. This makes its purpose as a
set of
strings and symbols to be used in formatting clearer.
Removed the millisPerHour protected field. This was not an
appropriate
field in a collection of formatting symbols.
Renamed getAmpms to getAmPmStrings. Renamed setAmpms to
setAmPmStrings.
The new names follow the capitalization standard and are clearer.
Removed methods useLocalizedPattern and setPatternLocalized. This
functionality can be obtained through the toLocalizedPattern and
applyLocalizedPattern methods of SimpleDateFormat. These methods
were not
appropriate in a collection of formatting symbols.
____________
TEXT CHANGES - DecimalFormat
Renamed getThousandsInterval and setThousandsInterval methods to
getGroupingSize and setGroupingSize. The new names are clearer.
Renamed getFactor and setFactor methods to getMultiplier and
setMultiplier.
The new names are clearer.
Changed the constructor that takes a NumberFormatData to use a
DecimalFormatSymbols object instead. See the change description for
NumberFormatData.
Added a constructor that takes just a String and figures out the
correct
DecimalFormatSymbols for the default locale. This fills in the
telescope
pattern for constructors.
Renamed getPattern method to toPattern. Also removed the boolean
argument
and instead added a toLocalizedPattern method. The new name better
reflects the fact that there is no "pattern" property, but rather a
pattern string is constructed that matches the current state of the
DecimalFormat object. Splitting the method into two allows many
users to
ignore the existence of toLocalizedPattern.
Renamed setPattern method to applyPattern. Also removed the boolean
argument and instead added an applyLocalizedPattern method. The new
name better reflects the fact that there is no "pattern" property,
but rather a pattern string is used to set the state of the
DecimalFormat
object. Splitting the method into two allows many users to ignore
the
existence of applyLocalizedPattern.
Removed the "*" and "_" characters from the pattern syntax. This
is not
strictly an api change but it is a semantic change. These
characters were
of limited use the way they were implemented.
Changed the format methods to take a FieldPosition rather than a
FormatStatus argument. See the change description for FormatStatus.
Changed the parse method to take a ParsePosition rather than a
ParseStatus argument. See the change description for ParseStatus.
Renamed getNumberFormatData to getDecimalFormatSymbols and changed
its
return type to DecimalFormatSymbols. Renamed setNumberFormatData
to
setDecimalFormatSymbols and changed its argument type to
DecimalFormatSymbols. See the change description for
NumberFormatData.
____________
TEXT CHANGES - Format
Changed the format method to take a FieldPosition rather than a
FormatStatus argument. See the change description for FormatStatus.
Changed the parseObject method to take a ParsePosition rather than
a
ParseStatus argument. See the change description for ParseStatus.
____________
TEXT CHANGES - FormatException
Renamed class to ParseException. This better reflects its purpose.
Removed the no argument constructor. This constructor was not
useful.
____________
TEXT CHANGES - FormatStatus
Renamed class to FieldPosition. This better reflects its purpose
as an
object which describes where sub-fields are located in a formatted
string.
Replaced public integer fields with getter methods. Adjusted names
to
match pattern for indicating ranges in text. The result:
int alignField ==> int getField()
int alignStart ==> int getBeginIndex()
int alignEnd ==> int getEndIndex()
Replaced no argument constructor with a constructor that sets the
field.
A field value must always be set so this prevents invalid objects.
It is also more convenient than doing it in two steps.
____________
TEXT CHANGES - MessageFormat
Redesigned the syntax for message patterns to allow inlining of
other
pattern strings, such as date patterns, number patterns, choice
patterns
etc. This is not itself an API change but is a big semantic
difference.
This change allows complete message formats to be created in fewer
steps.
Removed the constructor that took a String and a Format array.
This was
not needed with the new inline pattern syntax.
Added a setFormat method which allows a single format to be set at
a time
rather than requiring all formats to be specified like the
setFormats
method. This is more convenient given the inline pattern syntax.
Removed the format method that took a String, a Format array and an
Object
array. It was not necessary with the new inline pattern syntax.
Changed the parse method that takes a single String argument to
return an
array of Objects rather than a single Object. This makes more
sense given
the fact that a message may have many objects embedded in it.
Changed the format methods to take a FieldPosition rather than a
FormatStatus argument. See the change description for FormatStatus.
Changed the parse method to take a ParsePosition rather than a
ParseStatus
argument. See the change description for ParseStatus.
Renamed getPattern method to toPattern. The new name better
reflects the
fact that there is no "pattern" property. Rather a pattern string
is
constructed that matches the current state of the MessageFormat
object.
Renamed setPattern method to applyPattern. The new name better
reflects
the fact that there is no "pattern" property. Rather a pattern
string is
used to set the state of the MessageFormat object.
Added setLocale and getLocale methods.
____________
TEXT CHANGES - NumberFormat
Renamed getDefaultCurrency to getCurrencyInstance. Renamed
getDefaultPercent to getPercentInstance. Added a getNumberInstance
factory. Rename getDefault to getInstance. This follows the
naming
pattern for factories.
Removed getCurrencySymbol and getIntlCurrencySymbol methods. These
will be
added to a more appropriate class in a future release.
In the methods called
{get|set}{Minimum|Maximum}{Integer|Decimal}Count,
rename the word Count to Digits and the word Decimal to Fraction.
These
names are clearer.
Remove the methods isDecimalUsedWithInteger and
setDecimalUsedWithInteger. These methods are now found in
DecimalFormat
under the names isDecimalSeparatorAlwaysShown
setDecimalSeparatorAlwaysShown.
Renamed setIntegerOnly to setParseIntegerOnly. Renamed
isIntegerOnly to
isParseIntegerOnly.
Renamed {is|set}ThousandsUsed to {is|set}GroupingUsed.
Removed the getDisplayName methods. These returned the same result
as
the corresponding Locale.getDisplayName method calls. Until we
have more
useful data, its better not to have these methods in the API.
Renamed DECIMAL_FIELD to FRACTION_FIELD. Also changed its type from
byte
to int. This name is more general. Use of ints as constants is
standard
practice.
Removed NUMERATOR_FIELD, DENOMINATOR_FIELD and EXPONENT_FIELD. This
functionality was not supported in this release.
____________
TEXT CHANGES - NumberFormatData
Renamed class DecimalFormatSymbols. This makes its purpose as a set
of
strings and symbols to be used in formatting clearer.
Added a default constructor which constructs an object suitable for
the
default locale. Added a constructor which takes a locale. These
follow
the pattern set by DateFormatSymbols.
Removed starDigit, spaceDigit and exponential fields. This
functionality
is not being supported by DecimalFormat.
Changed public fields to getter/setter methods. Adjusted the names
of the
methods for clarity. The results are:
char zeroDigit; ==> getZeroDigit(), setZeroDigit()
char thousandsSign; ==> getGroupingSeparator(),
setGroupingSeparator()
char decimalSign; ==> getDecimalSeparator(),
setDecimalSeparator()
char millePercent; ==> getPerMill(), setPerMill()
char percent; ==> getPercent(), setPercent()
char digit; ==> getDigit(), setDigit()
char separator; ==> getPatternSeparator(),
setPatternSeparator()
java.lang.String infinity; ==> getInfinity(), setInfinity()
java.lang.String nan; ==> getNaN(), setNaN()
char minusSign; ==> getMinusSign(), setMinusSign()
Removed the static final char fields. These were not appropriate
for a
collection of locale specific number formatting fields. They were
also
of little use outside the implementation of DecimalFormat. The
removed
fields are:
static final char patternZeroDigit = 48;
static final char patternThousandsSign =
static final char patternDecimalSign = 4
static final char patternMillePercent =
static final char patternPercent = 37;
static final char patternDigit = 35;
static final char patternStarDigit = 42;
static final char patternSpaceDigit = 95
static final char patternSeparator = 59;
____________
TEXT CHANGES - ParseStatus
Renamed class ParsePosition. This better reflects its purpose as
an object
which shows where parsing starts and stops.
Removed no argument constructor. This was redundant and of no real
convenience.
Changed public field startAt to a getter/setter method pair. Also
adjusted names of the methods to suit the naming pattern for
indicating
characters in a String. The results:
startAt ==> getIndex(), setIndex()
____________
TEXT CHANGES - SimpleDateFormat
Changed the format method to take a FieldPosition rather than a
FormatStatus argument. See the change description for FormatStatus.
Changed the parse method to take a ParsePosition rather than a
ParseStatus
argument. See the change description for ParseStatus.
Changed the constructor which took a DateFormatData object to use a
DateFormatSymbols object instead. See the change description for
DateFormatData.
Renamed getDateFormatData and setDateFormatData to
getDateFormatSymbols
and setDateFormatSymbols. See the change description for
DateFormatData.
Renamed getPattern method to toPattern. Also removed the boolean
argument
and instead added a toLocalizedPattern method. The new name better
reflects the fact that there is no "pattern" property, but rather a
pattern string is constructed that matches the current state of the
DecimalFormat object. Splitting the method into two allows many
users
to ignore the existence of toLocalizedPattern.
Renamed setPattern method to applyPattern. Also removed the boolean
argument and instead added an applyLocalizedPattern method. The new
name better reflects the fact that there is no "pattern" property,
but
rather a pattern string is used to set the state of the
DecimalFormat
object. Splitting the method into two allows many users to ignore
the
existence of applyLocalizedPattern.
Added a convenience no argument constructor.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -