--- old/src/java.base/share/classes/java/text/DecimalFormat.java 2019-03-21 08:42:54.777961541 -0700
+++ new/src/java.base/share/classes/java/text/DecimalFormat.java 2019-03-21 08:42:53.941942243 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -54,20 +54,20 @@
import sun.util.locale.provider.ResourceBundleBasedAdapter;
/**
- * DecimalFormat
is a concrete subclass of
- * NumberFormat
that formats decimal numbers. It has a variety of
+ * {@code DecimalFormat} is a concrete subclass of
+ * {@code NumberFormat} that formats decimal numbers. It has a variety of
* features designed to make it possible to parse and format numbers in any
* locale, including support for Western, Arabic, and Indic digits. It also
* supports different kinds of numbers, including integers (123), fixed-point
* numbers (123.4), scientific notation (1.23E4), percentages (12%), and
* currency amounts ($123). All of these can be localized.
*
- *
To obtain a NumberFormat
for a specific locale, including the
- * default locale, call one of NumberFormat
's factory methods, such
- * as getInstance()
. In general, do not call the
- * DecimalFormat
constructors directly, since the
- * NumberFormat
factory methods may return subclasses other than
- * DecimalFormat
. If you need to customize the format object, do
+ *
To obtain a {@code NumberFormat} for a specific locale, including the + * default locale, call one of {@code NumberFormat}'s factory methods, such + * as {@code getInstance()}. In general, do not call the + * {@code DecimalFormat} constructors directly, since the + * {@code NumberFormat} factory methods may return subclasses other than + * {@code DecimalFormat}. If you need to customize the format object, do * something like this: * *
* - *@@ -77,16 +77,16 @@ * } *
A DecimalFormat
comprises a pattern and a set of
+ *
A {@code DecimalFormat} comprises a pattern and a set of
* symbols. The pattern may be set directly using
- * applyPattern()
, or indirectly using the API methods. The
- * symbols are stored in a DecimalFormatSymbols
object. When using
- * the NumberFormat
factory methods, the pattern and symbols are
- * read from localized ResourceBundle
s.
+ * {@code applyPattern()}, or indirectly using the API methods. The
+ * symbols are stored in a {@code DecimalFormatSymbols} object. When using
+ * the {@code NumberFormat} factory methods, the pattern and symbols are
+ * read from localized {@code ResourceBundle}s.
*
*
DecimalFormat
patterns have the following syntax:
+ * {@code DecimalFormat} patterns have the following syntax:
* * - ** Pattern: * PositivePattern @@ -123,26 +123,26 @@ * 0 MinimumExponentopt *
A DecimalFormat
pattern contains a positive and negative
- * subpattern, for example, "#,##0.00;(#,##0.00)"
. Each
+ *
A {@code DecimalFormat} pattern contains a positive and negative
+ * subpattern, for example, {@code "#,##0.00;(#,##0.00)"}. Each
* subpattern has a prefix, numeric part, and suffix. The negative subpattern
* is optional; if absent, then the positive subpattern prefixed with the
- * localized minus sign ('-'
in most locales) is used as the
- * negative subpattern. That is, "0.00"
alone is equivalent to
- * "0.00;-0.00"
. If there is an explicit negative subpattern, it
+ * localized minus sign ({@code '-'} in most locales) is used as the
+ * negative subpattern. That is, {@code "0.00"} alone is equivalent to
+ * {@code "0.00;-0.00"}. If there is an explicit negative subpattern, it
* serves only to specify the negative prefix and suffix; the number of digits,
* minimal digits, and other characteristics are all the same as the positive
- * pattern. That means that "#,##0.0#;(#)"
produces precisely
- * the same behavior as "#,##0.0#;(#,##0.0#)"
.
+ * pattern. That means that {@code "#,##0.0#;(#)"} produces precisely
+ * the same behavior as {@code "#,##0.0#;(#,##0.0#)"}.
*
*
The prefixes, suffixes, and various symbols used for infinity, digits,
* thousands separators, decimal separators, etc. may be set to arbitrary
* values, and they will appear properly during formatting. However, care must
* be taken that the symbols and strings do not conflict, or parsing will be
* unreliable. For example, either the positive and negative prefixes or the
- * suffixes must be distinct for DecimalFormat.parse()
to be able
+ * suffixes must be distinct for {@code DecimalFormat.parse()} to be able
* to distinguish positive from negative values. (If they are identical, then
- * DecimalFormat
will behave as if no negative subpattern was
+ * {@code DecimalFormat} will behave as if no negative subpattern was
* specified.) Another example is that the decimal separator and thousands
* separator should be distinct characters, or parsing will be impossible.
*
@@ -151,8 +151,8 @@
* of digits between the grouping characters, such as 3 for 100,000,000 or 4 for
* 1,0000,0000. If you supply a pattern with multiple grouping characters, the
* interval between the last one and the end of the integer is the one that is
- * used. So "#,##,###,####"
== "######,####"
==
- * "##,####,####"
.
+ * used. So {@code "#,##,###,####"} == {@code "######,####"} ==
+ * {@code "##,####,####"}.
*
*
The characters listed here are used in non-localized patterns. Localized
* patterns use the corresponding characters taken from this formatter's
- * DecimalFormatSymbols
object instead, and these characters lose
+ * {@code DecimalFormatSymbols} object instead, and these characters lose
* their special status. Two exceptions are the currency sign and quote, which
* are not localized.
*
@@ -180,53 +180,53 @@
*
*
0
+ * #
+ * .
+ * -
+ * ,
+ * E
+ * ;
+ * %
+ * \u2030
+ * ¤
(\u00A4
)
+ * '
+ * "'#'#"
formats 123 to
- * "#123"
. To create a single quote
- * itself, use two in a row: "# o''clock"
.
+ * for example, {@code "'#'#"} formats 123 to
+ * {@code "#123"}. To create a single quote
+ * itself, use two in a row: {@code "# o''clock"}.
* DecimalFormat
can be instructed to format and parse scientific
+ * {@code DecimalFormat} can be instructed to format and parse scientific
* notation only via a pattern; there is currently no factory method
* that creates a scientific notation format. In a pattern, the exponent
* character immediately followed by one or more digit characters indicates
- * scientific notation. Example: "0.###E0"
formats the number
- * 1234 as "1.234E3"
.
+ * scientific notation. Example: {@code "0.###E0"} formats the number
+ * 1234 as {@code "1.234E3"}.
*
* "0.###E0 m/s"
.
+ * from the pattern. This allows patterns such as {@code "0.###E0 m/s"}.
*
* "##0.#####E0"
. Using this pattern, the number 12345
- * formats to "12.345E3"
, and 123456 formats to
- * "123.456E3"
.
+ * e.g., {@code "##0.#####E0"}. Using this pattern, the number 12345
+ * formats to {@code "12.345E3"}, and 123456 formats to
+ * {@code "123.456E3"}.
*
* "00.###E0"
yields
- * "12.3E-4"
.
+ * exponent. Example: 0.00123 formatted with {@code "00.###E0"} yields
+ * {@code "12.3E-4"}.
* "##0.##E0"
is "12.3E3"
. To show all digits, set
+ * {@code "##0.##E0"} is {@code "12.3E3"}. To show all digits, set
* the significant digits count to zero. The number of significant digits
* does not affect parsing.
*
@@ -294,38 +294,38 @@
*
* DecimalFormat
provides rounding modes defined in
+ * {@code DecimalFormat} provides rounding modes defined in
* {@link java.math.RoundingMode} for formatting. By default, it uses
* {@link java.math.RoundingMode#HALF_EVEN RoundingMode.HALF_EVEN}.
*
* DecimalFormat
uses the ten consecutive
+ * For formatting, {@code DecimalFormat} uses the ten consecutive
* characters starting with the localized zero digit defined in the
- * DecimalFormatSymbols
object as digits. For parsing, these
+ * {@code DecimalFormatSymbols} object as digits. For parsing, these
* digits as well as all Unicode decimal digits, as defined by
* {@link Character#digit Character.digit}, are recognized.
*
* NaN
is formatted as a string, which typically has a single character
- * \uFFFD
. This string is determined by the
- * DecimalFormatSymbols
object. This is the only value for which
+ *
{@code NaN} is formatted as a string, which typically has a single character + * {@code \uFFFD}. This string is determined by the + * {@code DecimalFormatSymbols} object. This is the only value for which * the prefixes and suffixes are not used. * *
Infinity is formatted as a string, which typically has a single character
- * \u221E
, with the positive or negative prefixes and suffixes
+ * {@code \u221E}, with the positive or negative prefixes and suffixes
* applied. The infinity string is determined by the
- * DecimalFormatSymbols
object.
+ * {@code DecimalFormatSymbols} object.
*
- *
Negative zero ("-0"
) parses to
+ *
Negative zero ({@code "-0"}) parses to *
BigDecimal(0)
if isParseBigDecimal()
is
+ * Long(0)
if isParseBigDecimal()
is false
- * and isParseIntegerOnly()
is true,
- * Double(-0.0)
if both isParseBigDecimal()
- * and isParseIntegerOnly()
are false.
+ * pattern
is null
+ * @exception NullPointerException if {@code pattern} is null
* @exception IllegalArgumentException if the given pattern is invalid.
* @see java.text.NumberFormat#getInstance
* @see java.text.NumberFormat#getNumberInstance
@@ -475,7 +475,7 @@
*
* This implementation uses the maximum precision permitted.
* @param number the number to format
- * @param toAppendTo the StringBuffer
to which the formatted
+ * @param toAppendTo the {@code StringBuffer} to which the formatted
* text is to be appended
* @param pos keeps track on the position of the field within the
* returned string. For example, for formatting a number
@@ -485,11 +485,11 @@
* and end index of {@code fieldPosition} will be set
* to 0 and 9, respectively for the output string
* {@code 1,234,567.89}.
- * @return the value passed in as toAppendTo
- * @exception IllegalArgumentException if number
is
- * null or not an instance of Number
.
- * @exception NullPointerException if toAppendTo
or
- * pos
is null
+ * @return the value passed in as {@code toAppendTo}
+ * @exception IllegalArgumentException if {@code number} is
+ * null or not an instance of {@code Number}.
+ * @exception NullPointerException if {@code toAppendTo} or
+ * {@code pos} is null
* @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.FieldPosition
@@ -914,13 +914,13 @@
}
/**
- * Formats an Object producing an AttributedCharacterIterator
.
- * You can use the returned AttributedCharacterIterator
+ * Formats an Object producing an {@code AttributedCharacterIterator}.
+ * You can use the returned {@code AttributedCharacterIterator}
* to build the resulting String, as well as to determine information
* about the resulting String.
*
* Each attribute key of the AttributedCharacterIterator will be of type
- * NumberFormat.Field
, with the attribute value being the
+ * {@code NumberFormat.Field}, with the attribute value being the
* same as the attribute key.
*
* @exception NullPointerException if obj is null.
@@ -1916,7 +1916,7 @@
if (negativeExponent) {
exponent = -exponent;
fieldStart = result.length();
- result.append(symbols.getMinusSign());
+ result.append(symbols.getMinusSignText());
delegate.formatted(Field.EXPONENT_SIGN, Field.EXPONENT_SIGN,
fieldStart, result.length(), result);
}
@@ -2042,17 +2042,17 @@
}
/**
- * Appends the String string
to result
.
- * delegate
is notified of all the
- * FieldPosition
s in positions
.
+ * Appends the String {@code string} to {@code result}.
+ * {@code delegate} is notified of all the
+ * {@code FieldPosition}s in {@code positions}.
*
- * If one of the FieldPosition
s in positions
- * identifies a SIGN
attribute, it is mapped to
- * signAttribute
. This is used
- * to map the SIGN
attribute to the EXPONENT
+ * If one of the {@code FieldPosition}s in {@code positions}
+ * identifies a {@code SIGN} attribute, it is mapped to
+ * {@code signAttribute}. This is used
+ * to map the {@code SIGN} attribute to the {@code EXPONENT}
* attribute as necessary.
*
- * This is used by subformat
to add the prefix/suffix.
+ * This is used by {@code subformat} to add the prefix/suffix.
*/
private void append(StringBuffer result, String string,
FieldDelegate delegate,
@@ -2078,60 +2078,60 @@
}
/**
- * Parses text from a string to produce a Number
.
+ * Parses text from a string to produce a {@code Number}.
*
* The method attempts to parse text starting at the index given by
- * pos
.
- * If parsing succeeds, then the index of pos
is updated
+ * {@code pos}.
+ * If parsing succeeds, then the index of {@code pos} is updated
* to the index after the last character used (parsing does not necessarily
* use all characters up to the end of the string), and the parsed
- * number is returned. The updated pos
can be used to
+ * number is returned. The updated {@code pos} can be used to
* indicate the starting point for the next call to this method.
- * If an error occurs, then the index of pos
is not
- * changed, the error index of pos
is set to the index of
+ * If an error occurs, then the index of {@code pos} is not
+ * changed, the error index of {@code pos} is set to the index of
* the character where the error occurred, and null is returned.
*
* The subclass returned depends on the value of {@link #isParseBigDecimal} * as well as on the string being parsed. *
isParseBigDecimal()
is false (the default),
- * most integer values are returned as Long
- * objects, no matter how they are written: "17"
and
- * "17.000"
both parse to Long(17)
.
- * Values that cannot fit into a Long
are returned as
- * Double
s. This includes values with a fractional part,
- * infinite values, NaN
, and the value -0.0.
- * DecimalFormat
does not decide whether to
- * return a Double
or a Long
based on the
+ * "-9,223,372,036,854,775,808.00"
, from being
+ * such as {@code "-9,223,372,036,854,775,808.00"}, from being
* parsed accurately.
*
- * Callers may use the Number
methods
- * doubleValue
, longValue
, etc., to obtain
+ * Callers may use the {@code Number} methods
+ * {@code doubleValue}, {@code longValue}, etc., to obtain
* the type they want.
- *
isParseBigDecimal()
is true, values are returned
- * as BigDecimal
objects. The values are the ones
+ * Double
instances holding the values of the
- * corresponding Double
constants.
+ * as {@code Double} instances holding the values of the
+ * corresponding {@code Double} constants.
*
- * Example Example {@code "#,#00.0#"} → 1,234.56
* This means a minimum of 2 integer digits, 1 fraction digit, and
* a maximum of 2 fraction digits.
- * Example: Example: {@code "#,#00.0#;(#,#00.0#)"} for negatives in
* parentheses.
* In negative patterns, the minimum and maximum counts are ignored;
* these are presumed to be set in the positive pattern.
*
* @param pattern a new pattern
- * @exception NullPointerException if Example Example {@code "#,#00.0#"} → 1,234.56
* This means a minimum of 2 integer digits, 1 fraction digit, and
* a maximum of 2 fraction digits.
- * Example: Example: {@code "#,#00.0#;(#,#00.0#)"} for negatives in
* parentheses.
* In negative patterns, the minimum and maximum counts are ignored;
* these are presumed to be set in the positive pattern.
*
* @param pattern a new pattern
- * @exception NullPointerException if Stream versions older than 2 will not have the affix pattern variables
- * This pattern is expanded by the method This pattern is expanded by the method {@code expandAffix()} to
+ * {@code positivePrefix} to update the latter to reflect changes in
+ * {@code symbols}. If this variable is {@code null} then
+ * {@code positivePrefix} is taken as a literal value that does not
+ * change when {@code symbols} changes. This variable is always
+ * {@code null} for {@code DecimalFormat} objects older than
* stream version 2 restored from stream.
*
* @serial
@@ -3977,8 +3967,8 @@
/**
* The suffix pattern for non-negative numbers. This variable corresponds
- * to DecimalFormat
parses all Unicode characters that represent
- * decimal digits, as defined by Character.digit()
. In
- * addition, DecimalFormat
also recognizes as digits the ten
+ * {@code DecimalFormat} parses all Unicode characters that represent
+ * decimal digits, as defined by {@code Character.digit()}. In
+ * addition, {@code DecimalFormat} also recognizes as digits the ten
* consecutive characters starting with the localized zero digit defined in
- * the DecimalFormatSymbols
object.
+ * the {@code DecimalFormatSymbols} object.
*
* @param text the string to be parsed
- * @param pos A ParsePosition
object with index and error
+ * @param pos A {@code ParsePosition} object with index and error
* index information as described above.
- * @return the parsed value, or null
if the parse fails
- * @exception NullPointerException if text
or
- * pos
is null.
+ * @return the parsed value, or {@code null} if the parse fails
+ * @exception NullPointerException if {@code text} or
+ * {@code pos} is null.
*/
@Override
public Number parse(String text, ParsePosition pos) {
@@ -2475,7 +2475,7 @@
boolean[] stat = new boolean[STATUS_LENGTH];
DigitList exponentDigits = new DigitList();
- if (subparse(text, pos, "", Character.toString(symbols.getMinusSign()), exponentDigits, true, stat) &&
+ if (subparse(text, pos, "", symbols.getMinusSignText(), exponentDigits, true, stat) &&
exponentDigits.fitsIntoLong(stat[STATUS_POSITIVE], true)) {
position = pos.index; // Advance past the exponent
exponent = (int)exponentDigits.getLong();
@@ -2573,7 +2573,7 @@
/**
* Returns the FieldPositions of the fields in the prefix used for
* positive numbers. This is not used if the user has explicitly set
- * a positive prefix via setPositivePrefix
. This is
+ * a positive prefix via {@code setPositivePrefix}. This is
* lazily created.
*
* @return FieldPositions in positive prefix
@@ -2614,7 +2614,7 @@
/**
* Returns the FieldPositions of the fields in the prefix used for
* negative numbers. This is not used if the user has explicitly set
- * a negative prefix via setNegativePrefix
. This is
+ * a negative prefix via {@code setNegativePrefix}. This is
* lazily created.
*
* @return FieldPositions in positive prefix
@@ -2655,7 +2655,7 @@
/**
* Returns the FieldPositions of the fields in the suffix used for
* positive numbers. This is not used if the user has explicitly set
- * a positive suffix via setPositiveSuffix
. This is
+ * a positive suffix via {@code setPositiveSuffix}. This is
* lazily created.
*
* @return FieldPositions in positive prefix
@@ -2696,7 +2696,7 @@
/**
* Returns the FieldPositions of the fields in the suffix used for
* negative numbers. This is not used if the user has explicitly set
- * a negative suffix via setNegativeSuffix
. This is
+ * a negative suffix via {@code setNegativeSuffix}. This is
* lazily created.
*
* @return FieldPositions in positive prefix
@@ -2811,7 +2811,7 @@
/**
* Returns whether the {@link #parse(java.lang.String, java.text.ParsePosition)}
- * method returns BigDecimal
. The default value is false.
+ * method returns {@code BigDecimal}. The default value is false.
*
* @return {@code true} if the parse method returns BigDecimal;
* {@code false} otherwise
@@ -2824,7 +2824,7 @@
/**
* Sets whether the {@link #parse(java.lang.String, java.text.ParsePosition)}
- * method returns BigDecimal
.
+ * method returns {@code BigDecimal}.
*
* @param newValue {@code true} if the parse method returns BigDecimal;
* {@code false} otherwise
@@ -2991,14 +2991,14 @@
}
continue;
case PATTERN_PERCENT:
- c = symbols.getPercent();
- break;
+ buffer.append(symbols.getPercentText());
+ continue;
case PATTERN_PER_MILLE:
- c = symbols.getPerMill();
- break;
+ buffer.append(symbols.getPerMillText());
+ continue;
case PATTERN_MINUS:
- c = symbols.getMinusSign();
- break;
+ buffer.append(symbols.getMinusSignText());
+ continue;
}
}
buffer.append(c);
@@ -3027,12 +3027,11 @@
for (int i=0; i"#,#00.0#"
→ 1,234.56
+ * "#,#00.0#;(#,#00.0#)"
for negatives in
+ * pattern
is null
+ * @exception NullPointerException if {@code pattern} is null
* @exception IllegalArgumentException if the given pattern is invalid.
*/
public void applyPattern(String pattern) {
@@ -3282,16 +3272,16 @@
* by this routine, since that is the typical end-user desire;
* use setMaximumInteger if you want to set a real value.
* For negative numbers, use a second pattern, separated by a semicolon
- * "#,#00.0#"
→ 1,234.56
+ * "#,#00.0#;(#,#00.0#)"
for negatives in
+ * pattern
is null
+ * @exception NullPointerException if {@code pattern} is null
* @exception IllegalArgumentException if the given pattern is invalid.
*/
public void applyLocalizedPattern(String pattern) {
@@ -3309,7 +3299,7 @@
char perMill = PATTERN_PER_MILLE;
char digit = PATTERN_DIGIT;
char separator = PATTERN_SEPARATOR;
- String exponent = PATTERN_EXPONENT;
+ String exponent = PATTERN_EXPONENT;
char minus = PATTERN_MINUS;
if (localized) {
zeroDigit = symbols.getZeroDigit();
@@ -3635,8 +3625,8 @@
/**
* Sets the maximum number of digits allowed in the integer portion of a
* number.
- * For formatting numbers other than BigInteger
and
- * BigDecimal
objects, the lower of newValue
and
+ * For formatting numbers other than {@code BigInteger} and
+ * {@code BigDecimal} objects, the lower of {@code newValue} and
* 309 is used. Negative input values are replaced with 0.
* @see NumberFormat#setMaximumIntegerDigits
*/
@@ -3656,8 +3646,8 @@
/**
* Sets the minimum number of digits allowed in the integer portion of a
* number.
- * For formatting numbers other than BigInteger
and
- * BigDecimal
objects, the lower of newValue
and
+ * For formatting numbers other than {@code BigInteger} and
+ * {@code BigDecimal} objects, the lower of {@code newValue} and
* 309 is used. Negative input values are replaced with 0.
* @see NumberFormat#setMinimumIntegerDigits
*/
@@ -3677,8 +3667,8 @@
/**
* Sets the maximum number of digits allowed in the fraction portion of a
* number.
- * For formatting numbers other than BigInteger
and
- * BigDecimal
objects, the lower of newValue
and
+ * For formatting numbers other than {@code BigInteger} and
+ * {@code BigDecimal} objects, the lower of {@code newValue} and
* 340 is used. Negative input values are replaced with 0.
* @see NumberFormat#setMaximumFractionDigits
*/
@@ -3698,8 +3688,8 @@
/**
* Sets the minimum number of digits allowed in the fraction portion of a
* number.
- * For formatting numbers other than BigInteger
and
- * BigDecimal
objects, the lower of newValue
and
+ * For formatting numbers other than {@code BigInteger} and
+ * {@code BigDecimal} objects, the lower of {@code newValue} and
* 340 is used. Negative input values are replaced with 0.
* @see NumberFormat#setMinimumFractionDigits
*/
@@ -3719,8 +3709,8 @@
/**
* Gets the maximum number of digits allowed in the integer portion of a
* number.
- * For formatting numbers other than BigInteger
and
- * BigDecimal
objects, the lower of the return value and
+ * For formatting numbers other than {@code BigInteger} and
+ * {@code BigDecimal} objects, the lower of the return value and
* 309 is used.
* @see #setMaximumIntegerDigits
*/
@@ -3732,8 +3722,8 @@
/**
* Gets the minimum number of digits allowed in the integer portion of a
* number.
- * For formatting numbers other than BigInteger
and
- * BigDecimal
objects, the lower of the return value and
+ * For formatting numbers other than {@code BigInteger} and
+ * {@code BigDecimal} objects, the lower of the return value and
* 309 is used.
* @see #setMinimumIntegerDigits
*/
@@ -3745,8 +3735,8 @@
/**
* Gets the maximum number of digits allowed in the fraction portion of a
* number.
- * For formatting numbers other than BigInteger
and
- * BigDecimal
objects, the lower of the return value and
+ * For formatting numbers other than {@code BigInteger} and
+ * {@code BigDecimal} objects, the lower of the return value and
* 340 is used.
* @see #setMaximumFractionDigits
*/
@@ -3758,8 +3748,8 @@
/**
* Gets the minimum number of digits allowed in the fraction portion of a
* number.
- * For formatting numbers other than BigInteger
and
- * BigDecimal
objects, the lower of the return value and
+ * For formatting numbers other than {@code BigInteger} and
+ * {@code BigDecimal} objects, the lower of the return value and
* 340 is used.
* @see #setMinimumFractionDigits
*/
@@ -3775,7 +3765,7 @@
* {@link DecimalFormatSymbols#getCurrency DecimalFormatSymbols.getCurrency}
* on this number format's symbols.
*
- * @return the currency used by this decimal format, or null
+ * @return the currency used by this decimal format, or {@code null}
* @since 1.4
*/
@Override
@@ -3792,7 +3782,7 @@
* on this number format's symbols.
*
* @param currency the new currency to be used by this decimal format
- * @exception NullPointerException if currency
is null
+ * @exception NullPointerException if {@code currency} is null
* @since 1.4
*/
@Override
@@ -3809,7 +3799,7 @@
/**
* Gets the {@link java.math.RoundingMode} used in this DecimalFormat.
*
- * @return The RoundingMode
used for this DecimalFormat.
+ * @return The {@code RoundingMode} used for this DecimalFormat.
* @see #setRoundingMode(RoundingMode)
* @since 1.6
*/
@@ -3821,9 +3811,9 @@
/**
* Sets the {@link java.math.RoundingMode} used in this DecimalFormat.
*
- * @param roundingMode The RoundingMode
to be used
+ * @param roundingMode The {@code RoundingMode} to be used
* @see #getRoundingMode()
- * @exception NullPointerException if roundingMode
is null.
+ * @exception NullPointerException if {@code roundingMode} is null.
* @since 1.6
*/
@Override
@@ -3845,38 +3835,38 @@
* BigInteger
and BigDecimal
objects. These
+ * {@code BigInteger} and {@code BigDecimal} objects. These
* limits are stored in the superclass for serialization compatibility
- * with older versions, while the limits for BigInteger
and
- * BigDecimal
objects are kept in this class.
+ * with older versions, while the limits for {@code BigInteger} and
+ * {@code BigDecimal} objects are kept in this class.
* If, in the superclass, the minimum or maximum integer digit count is
- * larger than DOUBLE_INTEGER_DIGITS
or if the minimum or
+ * larger than {@code DOUBLE_INTEGER_DIGITS} or if the minimum or
* maximum fraction digit count is larger than
- * DOUBLE_FRACTION_DIGITS
, then the stream data is invalid
- * and this method throws an InvalidObjectException
.
+ * {@code DOUBLE_FRACTION_DIGITS}, then the stream data is invalid
+ * and this method throws an {@code InvalidObjectException}.
* serialVersionOnStream
is less than 4, initialize
- * roundingMode
to {@link java.math.RoundingMode#HALF_EVEN
+ * If {@code serialVersionOnStream} is less than 4, initialize
+ * {@code roundingMode} to {@link java.math.RoundingMode#HALF_EVEN
* RoundingMode.HALF_EVEN}. This field is new with version 4.
* serialVersionOnStream
is less than 3, then call
+ * If {@code serialVersionOnStream} is less than 3, then call
* the setters for the minimum and maximum integer and fraction digits with
* the values of the corresponding superclass getters to initialize the
* fields in this class. The fields in this class are new with version 3.
* serialVersionOnStream
is less than 1, indicating that
+ * If {@code serialVersionOnStream} is less than 1, indicating that
* the stream was written by JDK 1.1, initialize
- * useExponentialNotation
+ * {@code useExponentialNotation}
* to false, since it was not present in JDK 1.1.
* serialVersionOnStream
to the maximum allowed value so
+ * Set {@code serialVersionOnStream} to the maximum allowed value so
* that default serialization will work properly if this object is streamed
* out again.
*
*
* posPrefixPattern
etc. As a result, they will be initialized
- * to null
, which means the affix strings will be taken as
+ * {@code posPrefixPattern} etc. As a result, they will be initialized
+ * to {@code null}, which means the affix strings will be taken as
* literal values. This is exactly what we want, since that corresponds to
* the pre-version-2 behavior.
*/
@@ -3960,14 +3950,14 @@
/**
* The prefix pattern for non-negative numbers. This variable corresponds
- * to positivePrefix
.
+ * to {@code positivePrefix}.
*
- * expandAffix()
to
- * positivePrefix
to update the latter to reflect changes in
- * symbols
. If this variable is null
then
- * positivePrefix
is taken as a literal value that does not
- * change when symbols
changes. This variable is always
- * null
for DecimalFormat
objects older than
+ * positiveSuffix
. This variable is analogous to
- * posPrefixPattern
; see that variable for further
+ * to {@code positiveSuffix}. This variable is analogous to
+ * {@code posPrefixPattern}; see that variable for further
* documentation.
*
* @serial
@@ -3988,8 +3978,8 @@
/**
* The prefix pattern for negative numbers. This variable corresponds
- * to negativePrefix
. This variable is analogous to
- * posPrefixPattern
; see that variable for further
+ * to {@code negativePrefix}. This variable is analogous to
+ * {@code posPrefixPattern}; see that variable for further
* documentation.
*
* @serial
@@ -3999,8 +3989,8 @@
/**
* The suffix pattern for negative numbers. This variable corresponds
- * to negativeSuffix
. This variable is analogous to
- * posPrefixPattern
; see that variable for further
+ * to {@code negativeSuffix}. This variable is analogous to
+ * {@code posPrefixPattern}; see that variable for further
* documentation.
*
* @serial
@@ -4019,7 +4009,7 @@
/**
* The number of digits between grouping separators in the integer
* portion of a number. Must be greater than 0 if
- * NumberFormat.groupingUsed
is true.
+ * {@code NumberFormat.groupingUsed} is true.
*
* @serial
* @see #getGroupingSize
@@ -4053,7 +4043,7 @@
private transient boolean isCurrencyFormat = false;
/**
- * The DecimalFormatSymbols
object used by this format.
+ * The {@code DecimalFormatSymbols} object used by this format.
* It contains the symbols used to format numbers, e.g. the grouping separator,
* decimal separator, and so on.
*
@@ -4074,28 +4064,28 @@
/**
* FieldPositions describing the positive prefix String. This is
- * lazily created. Use getPositivePrefixFieldPositions
+ * lazily created. Use {@code getPositivePrefixFieldPositions}
* when needed.
*/
private transient FieldPosition[] positivePrefixFieldPositions;
/**
* FieldPositions describing the positive suffix String. This is
- * lazily created. Use getPositiveSuffixFieldPositions
+ * lazily created. Use {@code getPositiveSuffixFieldPositions}
* when needed.
*/
private transient FieldPosition[] positiveSuffixFieldPositions;
/**
* FieldPositions describing the negative prefix String. This is
- * lazily created. Use getNegativePrefixFieldPositions
+ * lazily created. Use {@code getNegativePrefixFieldPositions}
* when needed.
*/
private transient FieldPosition[] negativePrefixFieldPositions;
/**
* FieldPositions describing the negative suffix String. This is
- * lazily created. Use getNegativeSuffixFieldPositions
+ * lazily created. Use {@code getNegativeSuffixFieldPositions}
* when needed.
*/
private transient FieldPosition[] negativeSuffixFieldPositions;
@@ -4103,7 +4093,7 @@
/**
* The minimum number of digits used to display the exponent when a number is
* formatted in exponential notation. This field is ignored if
- * useExponentialNotation
is not true.
+ * {@code useExponentialNotation} is not true.
*
* @serial
* @since 1.2
@@ -4112,9 +4102,9 @@
/**
* The maximum number of digits allowed in the integer portion of a
- * BigInteger
or BigDecimal
number.
- * maximumIntegerDigits
must be greater than or equal to
- * minimumIntegerDigits
.
+ * {@code BigInteger} or {@code BigDecimal} number.
+ * {@code maximumIntegerDigits} must be greater than or equal to
+ * {@code minimumIntegerDigits}.
*
* @serial
* @see #getMaximumIntegerDigits
@@ -4124,9 +4114,9 @@
/**
* The minimum number of digits allowed in the integer portion of a
- * BigInteger
or BigDecimal
number.
- * minimumIntegerDigits
must be less than or equal to
- * maximumIntegerDigits
.
+ * {@code BigInteger} or {@code BigDecimal} number.
+ * {@code minimumIntegerDigits} must be less than or equal to
+ * {@code maximumIntegerDigits}.
*
* @serial
* @see #getMinimumIntegerDigits
@@ -4136,9 +4126,9 @@
/**
* The maximum number of digits allowed in the fractional portion of a
- * BigInteger
or BigDecimal
number.
- * maximumFractionDigits
must be greater than or equal to
- * minimumFractionDigits
.
+ * {@code BigInteger} or {@code BigDecimal} number.
+ * {@code maximumFractionDigits} must be greater than or equal to
+ * {@code minimumFractionDigits}.
*
* @serial
* @see #getMaximumFractionDigits
@@ -4148,9 +4138,9 @@
/**
* The minimum number of digits allowed in the fractional portion of a
- * BigInteger
or BigDecimal
number.
- * minimumFractionDigits
must be less than or equal to
- * maximumFractionDigits
.
+ * {@code BigInteger} or {@code BigDecimal} number.
+ * {@code minimumFractionDigits} must be less than or equal to
+ * {@code maximumFractionDigits}.
*
* @serial
* @see #getMinimumFractionDigits
@@ -4247,19 +4237,19 @@
*
*
* @since 1.2
* @serial
useExponentialNotation
and
- * minExponentDigits
.
+ * {@code useExponentialNotation} and
+ * {@code minExponentDigits}.
* posPrefixPattern
, posSuffixPattern
,
- * negPrefixPattern
, and negSuffixPattern
.
+ * {@code posPrefixPattern}, {@code posSuffixPattern},
+ * {@code negPrefixPattern}, and {@code negSuffixPattern}.
* maximumIntegerDigits
,
- * minimumIntegerDigits
,
- * maximumFractionDigits
,
- * minimumFractionDigits
, and
- * parseBigDecimal
.
+ * {@code maximumIntegerDigits},
+ * {@code minimumIntegerDigits},
+ * {@code maximumFractionDigits},
+ * {@code minimumFractionDigits}, and
+ * {@code parseBigDecimal}.
* roundingMode
.
+ * {@code roundingMode}.
*