diff -r 69648476a89e -r a64012cb49d6 jdk/src/share/classes/java/text/DecimalFormat.java --- a/jdk/src/share/classes/java/text/DecimalFormat.java Thu Jul 25 20:03:20 2013 -0700 +++ b/jdk/src/share/classes/java/text/DecimalFormat.java Fri Jul 26 17:22:08 2013 +0900 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, 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 @@ -87,7 +87,7 @@ * the NumberFormat factory methods, the pattern and symbols are * read from localized ResourceBundles. * - *

Patterns

+ *

Patterns

* * DecimalFormat patterns have the following syntax: *
@@ -174,7 +174,7 @@
  * 
* - * + * * + * * + * * + * * + * * + * *
Symbol * Location * Localized? @@ -184,7 +184,7 @@ * Number * Yes * Digit - *
# * Number * Yes @@ -194,7 +194,7 @@ * Number * Yes * Decimal separator or monetary decimal separator - *
- * Number * Yes @@ -204,7 +204,7 @@ * Number * Yes * Grouping separator - *
E * Number * Yes @@ -215,7 +215,7 @@ * Subpattern boundary * Yes * Separates positive and negative subpatterns - *
% * Prefix or suffix * Yes @@ -225,7 +225,7 @@ * Prefix or suffix * Yes * Multiply by 1000 and show as per mille value - *
¤ (\u00A4) * Prefix or suffix * No @@ -248,7 +248,8 @@ * *

Numbers in scientific notation are expressed as the product of a mantissa * and a power of ten, for example, 1234 can be expressed as 1.234 x 10^3. The - * mantissa is often in the range 1.0 <= x < 10.0, but it need not be. + * mantissa is often in the range 1.0 ≤ x {@literal <} 10.0, but it need not + * be. * 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 @@ -336,13 +337,13 @@ * *

Example

* - *
+ * 
{@code
  * // Print out a number using the localized number, integer, currency,
  * // and percent format for each locale
  * Locale[] locales = NumberFormat.getAvailableLocales();
  * double myNumber = -1234.56;
  * NumberFormat form;
- * for (int j=0; j<4; ++j) {
+ * for (int j = 0; j < 4; ++j) {
  *     System.out.println("FORMAT");
  *     for (int i = 0; i < locales.length; ++i) {
  *         if (locales[i].getCountry().length() == 0) {
@@ -368,7 +369,7 @@
  *         } catch (ParseException e) {}
  *     }
  * }
- * 
+ * }
* * @see Java Tutorial * @see NumberFormat @@ -421,7 +422,7 @@ * return the most appropriate sub-class of NumberFormat for a given * locale. * - * @param pattern A non-localized pattern string. + * @param pattern a non-localized pattern string. * @exception NullPointerException if pattern is null * @exception IllegalArgumentException if the given pattern is invalid. * @see java.text.NumberFormat#getInstance @@ -2382,6 +2383,8 @@ /** * Get the positive prefix. *

Examples: +123, $123, sFr123 + * + * @return the positive prefix */ public String getPositivePrefix () { return positivePrefix; @@ -2390,6 +2393,8 @@ /** * Set the positive prefix. *

Examples: +123, $123, sFr123 + * + * @param newValue the new positive prefix */ public void setPositivePrefix (String newValue) { positivePrefix = newValue; @@ -2420,6 +2425,8 @@ /** * Get the negative prefix. *

Examples: -123, ($123) (with negative suffix), sFr-123 + * + * @return the negative prefix */ public String getNegativePrefix () { return negativePrefix; @@ -2428,6 +2435,8 @@ /** * Set the negative prefix. *

Examples: -123, ($123) (with negative suffix), sFr-123 + * + * @param newValue the new negative prefix */ public void setNegativePrefix (String newValue) { negativePrefix = newValue; @@ -2457,6 +2466,8 @@ /** * Get the positive suffix. *

Example: 123% + * + * @return the positive suffix */ public String getPositiveSuffix () { return positiveSuffix; @@ -2465,6 +2476,8 @@ /** * Set the positive suffix. *

Example: 123% + * + * @param newValue the new positive suffix */ public void setPositiveSuffix (String newValue) { positiveSuffix = newValue; @@ -2494,6 +2507,8 @@ /** * Get the negative suffix. *

Examples: -123%, ($123) (with positive suffixes) + * + * @return the negative suffix */ public String getNegativeSuffix () { return negativeSuffix; @@ -2502,6 +2517,8 @@ /** * Set the negative suffix. *

Examples: 123% + * + * @param newValue the new negative suffix */ public void setNegativeSuffix (String newValue) { negativeSuffix = newValue; @@ -2532,6 +2549,7 @@ * Gets the multiplier for use in percent, per mille, and similar * formats. * + * @return the multiplier * @see #setMultiplier(int) */ public int getMultiplier () { @@ -2549,6 +2567,7 @@ *

Example: with multiplier 100, 1.23 is formatted as "123", and * "123" is parsed into 1.23. * + * @param newValue the new multiplier * @see #getMultiplier */ public void setMultiplier (int newValue) { @@ -2571,6 +2590,8 @@ * Return the grouping size. Grouping size is the number of digits between * grouping separators in the integer portion of a number. For example, * in the number "123,456.78", the grouping size is 3. + * + * @return the grouping size * @see #setGroupingSize * @see java.text.NumberFormat#isGroupingUsed * @see java.text.DecimalFormatSymbols#getGroupingSeparator @@ -2585,6 +2606,8 @@ * in the number "123,456.78", the grouping size is 3. *
* The value passed in is converted to a byte, which may lose information. + * + * @param newValue the new grouping size * @see #getGroupingSize * @see java.text.NumberFormat#setGroupingUsed * @see java.text.DecimalFormatSymbols#setGroupingSeparator @@ -2597,7 +2620,10 @@ /** * Allows you to get the behavior of the decimal separator with integers. * (The decimal separator will always appear with decimals.) - *

Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345 + *

Example: Decimal ON: 12345 → 12345.; OFF: 12345 → 12345 + * + * @return {@code true} if the decimal separator is always shown; + * {@code false} otherwise */ public boolean isDecimalSeparatorAlwaysShown() { return decimalSeparatorAlwaysShown; @@ -2606,7 +2632,10 @@ /** * Allows you to set the behavior of the decimal separator with integers. * (The decimal separator will always appear with decimals.) - *

Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345 + *

Example: Decimal ON: 12345 → 12345.; OFF: 12345 → 12345 + * + * @param newValue {@code true} if the decimal separator is always shown; + * {@code false} otherwise */ public void setDecimalSeparatorAlwaysShown(boolean newValue) { decimalSeparatorAlwaysShown = newValue; @@ -2616,6 +2645,9 @@ /** * Returns whether the {@link #parse(java.lang.String, java.text.ParsePosition)} * method returns BigDecimal. The default value is false. + * + * @return {@code true} if the parse method returns BigDecimal; + * {@code false} otherwise * @see #setParseBigDecimal * @since 1.5 */ @@ -2626,6 +2658,9 @@ /** * Sets whether the {@link #parse(java.lang.String, java.text.ParsePosition)} * method returns BigDecimal. + * + * @param newValue {@code true} if the parse method returns BigDecimal; + * {@code false} otherwise * @see #isParseBigDecimal * @since 1.5 */ @@ -2712,6 +2747,8 @@ /** * Synthesizes a pattern string that represents the current state * of this Format object. + * + * @return a pattern string * @see #applyPattern */ public String toPattern() { @@ -2721,6 +2758,8 @@ /** * Synthesizes a localized pattern string that represents the current * state of this Format object. + * + * @return a localized pattern string * @see #applyPattern */ public String toLocalizedPattern() { @@ -3049,7 +3088,7 @@ * 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 - *

Example "#,#00.0#" -> 1,234.56 + *

Example "#,#00.0#" → 1,234.56 *

This means a minimum of 2 integer digits, 1 fraction digit, and * a maximum of 2 fraction digits. *

Example: "#,#00.0#;(#,#00.0#)" for negatives in @@ -3057,6 +3096,7 @@ *

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 pattern is null * @exception IllegalArgumentException if the given pattern is invalid. */ @@ -3075,7 +3115,7 @@ * 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 - *

Example "#,#00.0#" -> 1,234.56 + *

Example "#,#00.0#" → 1,234.56 *

This means a minimum of 2 integer digits, 1 fraction digit, and * a maximum of 2 fraction digits. *

Example: "#,#00.0#;(#,#00.0#)" for negatives in @@ -3083,6 +3123,7 @@ *

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 pattern is null * @exception IllegalArgumentException if the given pattern is invalid. */