* ¤ (\u00A4)
* | Prefix or suffix
* | No
@@ -248,7 +248,8 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
*
* 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 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
*
* 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 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
* } catch (ParseException e) {}
* }
* }
- *
+ * }
*
* @see Java Tutorial
* @see NumberFormat
@@ -421,7 +422,7 @@ public class DecimalFormat extends NumberFormat {
* 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 @@ public class DecimalFormat extends NumberFormat {
/**
* Get the positive prefix.
* Examples: +123, $123, sFr123
+ *
+ * @return the positive prefix
*/
public String getPositivePrefix () {
return positivePrefix;
@@ -2390,6 +2393,8 @@ public class DecimalFormat extends NumberFormat {
/**
* 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 @@ public class DecimalFormat extends NumberFormat {
/**
* 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 @@ public class DecimalFormat extends NumberFormat {
/**
* 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 @@ public class DecimalFormat extends NumberFormat {
/**
* Get the positive suffix.
* Example: 123%
+ *
+ * @return the positive suffix
*/
public String getPositiveSuffix () {
return positiveSuffix;
@@ -2465,6 +2476,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Set the positive suffix.
* Example: 123%
+ *
+ * @param newValue the new positive suffix
*/
public void setPositiveSuffix (String newValue) {
positiveSuffix = newValue;
@@ -2494,6 +2507,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Get the negative suffix.
* Examples: -123%, ($123) (with positive suffixes)
+ *
+ * @return the negative suffix
*/
public String getNegativeSuffix () {
return negativeSuffix;
@@ -2502,6 +2517,8 @@ public class DecimalFormat extends NumberFormat {
/**
* Set the negative suffix.
* Examples: 123%
+ *
+ * @param newValue the new negative suffix
*/
public void setNegativeSuffix (String newValue) {
negativeSuffix = newValue;
@@ -2532,6 +2549,7 @@ public class DecimalFormat extends NumberFormat {
* 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 @@ public class DecimalFormat extends NumberFormat {
* 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 @@ public class DecimalFormat extends NumberFormat {
* 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 @@ public class DecimalFormat extends NumberFormat {
* 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 @@ public class DecimalFormat extends NumberFormat {
/**
* 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 @@ public class DecimalFormat extends NumberFormat {
/**
* 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 @@ public class DecimalFormat extends NumberFormat {
/**
* 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 @@ public class DecimalFormat extends NumberFormat {
/**
* 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 @@ public class DecimalFormat extends NumberFormat {
/**
* 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 @@ public class DecimalFormat extends NumberFormat {
/**
* 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 @@ public class DecimalFormat extends NumberFormat {
* 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 @@ public class DecimalFormat extends NumberFormat {
* 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 @@ public class DecimalFormat extends NumberFormat {
* 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 @@ public class DecimalFormat extends NumberFormat {
* 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.
*/
diff --git a/src/share/classes/java/text/DecimalFormatSymbols.java b/src/share/classes/java/text/DecimalFormatSymbols.java
index f0b2212eaf564919ab743aea6be3d1ea30653a9b..55a344fb0b4a525b835e372a2fbaf19c0419154b 100644
--- a/src/share/classes/java/text/DecimalFormatSymbols.java
+++ b/src/share/classes/java/text/DecimalFormatSymbols.java
@@ -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
@@ -106,6 +106,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
* This may return a {@code NumberFormat} instance with the Thai numbering system,
* instead of the Latin numbering system.
*
+ * @param locale the desired locale
* @exception NullPointerException if locale is null
*/
public DecimalFormatSymbols( Locale locale ) {
@@ -122,7 +123,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
* implementations. It must contain at least a Locale
* instance equal to {@link java.util.Locale#US Locale.US}.
*
- * @return An array of locales for which localized
+ * @return an array of locales for which localized
* DecimalFormatSymbols instances are available.
* @since 1.6
*/
@@ -166,6 +167,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
*
* This may return a {@code NumberFormat} instance with the Thai numbering system,
* instead of the Latin numbering system.
+ *
* @param locale the desired locale.
* @return a DecimalFormatSymbols instance.
* @exception NullPointerException if locale is null
@@ -185,6 +187,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used for zero. Different for Arabic, etc.
+ *
+ * @return the character used for zero
*/
public char getZeroDigit() {
return zeroDigit;
@@ -192,6 +196,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used for zero. Different for Arabic, etc.
+ *
+ * @param zeroDigit the character used for zero
*/
public void setZeroDigit(char zeroDigit) {
this.zeroDigit = zeroDigit;
@@ -199,6 +205,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used for thousands separator. Different for French, etc.
+ *
+ * @return the grouping separator
*/
public char getGroupingSeparator() {
return groupingSeparator;
@@ -206,6 +214,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used for thousands separator. Different for French, etc.
+ *
+ * @param groupingSeparator the grouping separator
*/
public void setGroupingSeparator(char groupingSeparator) {
this.groupingSeparator = groupingSeparator;
@@ -213,6 +223,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used for decimal sign. Different for French, etc.
+ *
+ * @return the character used for decimal sign
*/
public char getDecimalSeparator() {
return decimalSeparator;
@@ -220,6 +232,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used for decimal sign. Different for French, etc.
+ *
+ * @param decimalSeparator the character used for decimal sign
*/
public void setDecimalSeparator(char decimalSeparator) {
this.decimalSeparator = decimalSeparator;
@@ -227,6 +241,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used for per mille sign. Different for Arabic, etc.
+ *
+ * @return the character used for per mille sign
*/
public char getPerMill() {
return perMill;
@@ -234,6 +250,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used for per mille sign. Different for Arabic, etc.
+ *
+ * @param perMill the character used for per mille sign
*/
public void setPerMill(char perMill) {
this.perMill = perMill;
@@ -241,6 +259,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used for percent sign. Different for Arabic, etc.
+ *
+ * @return the character used for percent sign
*/
public char getPercent() {
return percent;
@@ -248,6 +268,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used for percent sign. Different for Arabic, etc.
+ *
+ * @param percent the character used for percent sign
*/
public void setPercent(char percent) {
this.percent = percent;
@@ -255,6 +277,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used for a digit in a pattern.
+ *
+ * @return the character used for a digit in a pattern
*/
public char getDigit() {
return digit;
@@ -262,6 +286,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used for a digit in a pattern.
+ *
+ * @param digit the character used for a digit in a pattern
*/
public void setDigit(char digit) {
this.digit = digit;
@@ -270,6 +296,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the character used to separate positive and negative subpatterns
* in a pattern.
+ *
+ * @return the pattern separator
*/
public char getPatternSeparator() {
return patternSeparator;
@@ -278,6 +306,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the character used to separate positive and negative subpatterns
* in a pattern.
+ *
+ * @param patternSeparator the pattern separator
*/
public void setPatternSeparator(char patternSeparator) {
this.patternSeparator = patternSeparator;
@@ -286,6 +316,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the string used to represent infinity. Almost always left
* unchanged.
+ *
+ * @return the string representing infinity
*/
public String getInfinity() {
return infinity;
@@ -294,6 +326,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the string used to represent infinity. Almost always left
* unchanged.
+ *
+ * @param infinity the string representing infinity
*/
public void setInfinity(String infinity) {
this.infinity = infinity;
@@ -302,6 +336,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Gets the string used to represent "not a number". Almost always left
* unchanged.
+ *
+ * @return the string representing "not a number"
*/
public String getNaN() {
return NaN;
@@ -310,6 +346,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the string used to represent "not a number". Almost always left
* unchanged.
+ *
+ * @param NaN the string representing "not a number"
*/
public void setNaN(String NaN) {
this.NaN = NaN;
@@ -319,6 +357,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
* Gets the character used to represent minus sign. If no explicit
* negative format is specified, one is formed by prefixing
* minusSign to the positive format.
+ *
+ * @return the character representing minus sign
*/
public char getMinusSign() {
return minusSign;
@@ -328,6 +368,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
* 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.
+ *
+ * @param minusSign the character representing minus sign
*/
public void setMinusSign(char minusSign) {
this.minusSign = minusSign;
@@ -336,6 +378,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Returns the currency symbol for the currency of these
* DecimalFormatSymbols in their locale.
+ *
+ * @return the currency symbol
* @since 1.2
*/
public String getCurrencySymbol()
@@ -346,6 +390,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the currency symbol for the currency of these
* DecimalFormatSymbols in their locale.
+ *
+ * @param currency the currency symbol
* @since 1.2
*/
public void setCurrencySymbol(String currency)
@@ -356,6 +402,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Returns the ISO 4217 currency code of the currency of these
* DecimalFormatSymbols.
+ *
+ * @return the currency code
* @since 1.2
*/
public String getInternationalCurrencySymbol()
@@ -374,6 +422,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
* then the currency attribute is set to null and the currency symbol
* attribute is not modified.
*
+ * @param currencyCode the currency code
* @see #setCurrency
* @see #setCurrencySymbol
* @since 1.2
@@ -427,6 +476,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Returns the monetary decimal separator.
+ *
+ * @return the monetary decimal separator
* @since 1.2
*/
public char getMonetaryDecimalSeparator()
@@ -436,6 +487,8 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
/**
* Sets the monetary decimal separator.
+ *
+ * @param sep the monetary decimal separator
* @since 1.2
*/
public void setMonetaryDecimalSeparator(char sep)
diff --git a/src/share/classes/java/text/FieldPosition.java b/src/share/classes/java/text/FieldPosition.java
index 15a935378c61cc083cad3ef181804359e7828c9e..300c7e89822632cd056b90a39603f6b236a799d8 100644
--- a/src/share/classes/java/text/FieldPosition.java
+++ b/src/share/classes/java/text/FieldPosition.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2002, 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
@@ -100,6 +100,7 @@ public class FieldPosition {
* identified by constants, whose names typically end with _FIELD,
* in the various subclasses of Format.
*
+ * @param field the field identifier
* @see java.text.NumberFormat#INTEGER_FIELD
* @see java.text.NumberFormat#FRACTION_FIELD
* @see java.text.DateFormat#YEAR_FIELD
@@ -157,6 +158,8 @@ public class FieldPosition {
/**
* Retrieves the field identifier.
+ *
+ * @return the field identifier
*/
public int getField() {
return field;
@@ -164,6 +167,8 @@ public class FieldPosition {
/**
* Retrieves the index of the first character in the requested field.
+ *
+ * @return the begin index
*/
public int getBeginIndex() {
return beginIndex;
@@ -172,6 +177,8 @@ public class FieldPosition {
/**
* Retrieves the index of the character following the last character in the
* requested field.
+ *
+ * @return the end index
*/
public int getEndIndex() {
return endIndex;
@@ -179,6 +186,8 @@ public class FieldPosition {
/**
* Sets the begin index. For use by subclasses of Format.
+ *
+ * @param bi the begin index
* @since 1.2
*/
public void setBeginIndex(int bi) {
@@ -187,6 +196,8 @@ public class FieldPosition {
/**
* Sets the end index. For use by subclasses of Format.
+ *
+ * @param ei the end index
* @since 1.2
*/
public void setEndIndex(int ei) {
diff --git a/src/share/classes/java/text/Format.java b/src/share/classes/java/text/Format.java
index eac0f47986f2decdd28f7fc8d508d8484d02f918..7a9c2ec4ddf9cba007dcf5453580831a6d0cf427 100644
--- a/src/share/classes/java/text/Format.java
+++ b/src/share/classes/java/text/Format.java
@@ -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
@@ -58,7 +58,7 @@ import java.io.Serializable;
* no separator in between, and in this case the parseObject could
* not tell which digits belong to which number.
*
- * Subclassing
+ * Subclassing
*
*
* The Java Platform provides three specialized subclasses of Format--
diff --git a/src/share/classes/java/text/MessageFormat.java b/src/share/classes/java/text/MessageFormat.java
index e5c8c811f046aa3bea71cfb5a72cad35dcdac7a4..402a7fa52d96a7fb85574da6fb504d9431494821 100644
--- a/src/share/classes/java/text/MessageFormat.java
+++ b/src/share/classes/java/text/MessageFormat.java
@@ -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
@@ -68,7 +68,7 @@ import java.util.Locale;
* behavior is defined by the pattern that you provide as well as the
* subformats used for inserted arguments.
*
- *
+ *
*
* MessageFormat uses patterns of the following form:
*
@@ -287,10 +287,10 @@ import java.util.Locale;
* You can create the ChoiceFormat programmatically, as in the
* above example, or by using a pattern. See {@link ChoiceFormat}
* for more information.
- *
+ * {@code
* form.applyPattern(
- * "There {0,choice,0#are no files|1#is one file|1<are {0,number,integer} files}.");
- *
+ * "There {0,choice,0#are no files|1#is one file|1
*
*
* Note: As we see above, the string produced
@@ -778,7 +778,7 @@ public class MessageFormat extends Format {
*
* instanceof ChoiceFormat
* | any
- * | subformat.format(argument).indexOf('{') >= 0 ?
+ * subformat.format(argument).indexOf('{') >= 0 ?
* (new MessageFormat(subformat.format(argument), getLocale())).format(argument) :
* subformat.format(argument)
* |
@@ -811,6 +811,8 @@ public class MessageFormat extends Format {
* @param result where text is appended.
* @param pos On input: an alignment field, if desired.
* On output: the offsets of the alignment field.
+ * @return the string buffer passed in as {@code result}, with formatted
+ * text appended
* @exception IllegalArgumentException if an argument in the
* arguments array is not of the type
* expected by the format element(s) that use it.
@@ -828,6 +830,9 @@ public class MessageFormat extends Format {
* (new {@link #MessageFormat(String) MessageFormat}(pattern)).{@link #format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition) format}(arguments, new StringBuffer(), null).toString()
*
*
+ * @param pattern the pattern string
+ * @param arguments object(s) to format
+ * @return the formatted string
* @exception IllegalArgumentException if the pattern is invalid,
* or if an argument in the arguments array
* is not of the type expected by the format element(s)
@@ -940,6 +945,10 @@ public class MessageFormat extends Format {
* is comparing against the pattern "AAD {0} BBB", the error index is
* 0. When an error occurs, the call to this method will return null.
* If the source is null, return an empty array.
+ *
+ * @param source the string to parse
+ * @param pos the parse position
+ * @return an array of parsed objects
*/
public Object[] parse(String source, ParsePosition pos) {
if (source == null) {
diff --git a/src/share/classes/java/text/Normalizer.java b/src/share/classes/java/text/Normalizer.java
index 01e923c1a859dbc8b575356fdbeaabfee49d9842..88fdf2b29dac923deb407e7a1daac929d52ae9d3 100644
--- a/src/share/classes/java/text/Normalizer.java
+++ b/src/share/classes/java/text/Normalizer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -55,14 +55,12 @@ import sun.text.normalizer.NormalizerImpl;
*
*
* U+00C1 LATIN CAPITAL LETTER A WITH ACUTE
- *
*
* or as two separate characters (the "decomposed" form):
*
*
* U+0041 LATIN CAPITAL LETTER A
* U+0301 COMBINING ACUTE ACCENT
- *
*
* To a user of your program, however, both of these sequences should be
* treated as the same "user-level" character "A with acute accent". When you
@@ -78,13 +76,11 @@ import sun.text.normalizer.NormalizerImpl;
* U+0066 LATIN SMALL LETTER F
* U+0066 LATIN SMALL LETTER F
* U+0069 LATIN SMALL LETTER I
- *
*
* or as the single character
*
*
* U+FB03 LATIN SMALL LIGATURE FFI
- *
*
* The ffi ligature is not a distinct semantic character, and strictly speaking
* it shouldn't be in Unicode at all, but it was included for compatibility
diff --git a/src/share/classes/java/text/NumberFormat.java b/src/share/classes/java/text/NumberFormat.java
index c1b8310096b8ee512de4c3e56f8814a2914c42cc..2fdcad6216605ded48925af9cdbc13480ee560ae 100644
--- a/src/share/classes/java/text/NumberFormat.java
+++ b/src/share/classes/java/text/NumberFormat.java
@@ -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
@@ -73,34 +73,34 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* To format a number for the current Locale, use one of the factory
* class methods:
*
- *
- * myString = NumberFormat.getInstance().format(myNumber);
- *
+ * {@code
+ * myString = NumberFormat.getInstance().format(myNumber);
+ * }
*
* If you are formatting multiple numbers, it is
* more efficient to get the format and use it multiple times so that
* the system doesn't have to fetch the information about the local
* language and country conventions multiple times.
*
- *
+ * {@code
* NumberFormat nf = NumberFormat.getInstance();
* for (int i = 0; i < myNumber.length; ++i) {
* output.println(nf.format(myNumber[i]) + "; ");
* }
- *
+ * }
*
* To format a number for a different Locale, specify it in the
* call to getInstance.
*
- *
+ * {@code
* NumberFormat nf = NumberFormat.getInstance(Locale.FRENCH);
- *
+ * }
*
* You can also use a NumberFormat to parse numbers:
*
- *
+ * {@code
* myNumber = nf.parse(myString);
- *
+ * }
*
* Use getInstance or getNumberInstance to get the
* normal number format. Use getIntegerInstance to get an
@@ -125,8 +125,8 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* the detailed description for each these control methods,
*
* setParseIntegerOnly : only affects parsing, e.g.
- * if true, "3456.78" -> 3456 (and leaves the parse position just after index 6)
- * if false, "3456.78" -> 3456.78 (and leaves the parse position just after index 8)
+ * if true, "3456.78" → 3456 (and leaves the parse position just after index 6)
+ * if false, "3456.78" → 3456.78 (and leaves the parse position just after index 8)
* This is independent of formatting. If you want to not show a decimal point
* where there might be no digits after the decimal point, use
* setDecimalSeparatorAlwaysShown.
@@ -134,8 +134,8 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* setDecimalSeparatorAlwaysShown : only affects formatting, and only where
* there might be no digits after the decimal point, such as with a pattern
* like "#,##0.##", e.g.,
- * if true, 3456.00 -> "3,456."
- * if false, 3456.00 -> "3456"
+ * if true, 3456.00 → "3,456."
+ * if false, 3456.00 → "3456"
* This is independent of parsing. If you want parsing to stop at the decimal
* point, use setParseIntegerOnly.
*
@@ -166,7 +166,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* numbers: "(12)" for -12.
*
*
- *
+ *
*
*
* Number formats are generally not synchronized.
@@ -280,6 +280,9 @@ public abstract class NumberFormat extends Format {
/**
* Specialization of format.
+ *
+ * @param number the double number to format
+ * @return the formatted String
* @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
@@ -302,6 +305,9 @@ public abstract class NumberFormat extends Format {
/**
* Specialization of format.
+ *
+ * @param number the long number to format
+ * @return the formatted String
* @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
@@ -313,6 +319,12 @@ public abstract class NumberFormat extends Format {
/**
* Specialization of format.
+ *
+ * @param number the double number to format
+ * @param toAppendTo the StringBuffer to which the formatted text is to be
+ * appended
+ * @param pos the field position
+ * @return the formatted StringBuffer
* @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
@@ -323,6 +335,12 @@ public abstract class NumberFormat extends Format {
/**
* Specialization of format.
+ *
+ * @param number the long number to format
+ * @param toAppendTo the StringBuffer to which the formatted text is to be
+ * appended
+ * @param pos the field position
+ * @return the formatted StringBuffer
* @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
@@ -339,6 +357,10 @@ public abstract class NumberFormat extends Format {
* after the 1).
* Does not throw an exception; if no object can be parsed, index is
* unchanged!
+ *
+ * @param source the String to parse
+ * @param parsePosition the parse position
+ * @return the parsed value
* @see java.text.NumberFormat#isParseIntegerOnly
* @see java.text.Format#parseObject
*/
@@ -373,6 +395,9 @@ public abstract class NumberFormat extends Format {
* would stop at the "." character. Of course, the exact format accepted
* by the parse operation is locale dependant and determined by sub-classes
* of NumberFormat.
+ *
+ * @return {@code true} if numbers should be parsed as integers only;
+ * {@code false} otherwise
*/
public boolean isParseIntegerOnly() {
return parseIntegerOnly;
@@ -380,6 +405,9 @@ public abstract class NumberFormat extends Format {
/**
* Sets whether or not numbers should be parsed as integers only.
+ *
+ * @param value {@code true} if numbers should be parsed as integers only;
+ * {@code false} otherwise
* @see #isParseIntegerOnly
*/
public void setParseIntegerOnly(boolean value) {
@@ -393,6 +421,9 @@ public abstract class NumberFormat extends Format {
* {@link java.util.Locale.Category#FORMAT FORMAT} locale.
* This is the same as calling
* {@link #getNumberInstance() getNumberInstance()}.
+ *
+ * @return the {@code NumberFormat} instance for general-purpose number
+ * formatting
*/
public final static NumberFormat getInstance() {
return getInstance(Locale.getDefault(Locale.Category.FORMAT), NUMBERSTYLE);
@@ -402,6 +433,10 @@ public abstract class NumberFormat extends Format {
* Returns a general-purpose number format for the specified locale.
* This is the same as calling
* {@link #getNumberInstance(java.util.Locale) getNumberInstance(inLocale)}.
+ *
+ * @param inLocale the desired locale
+ * @return the {@code NumberFormat} instance for general-purpose number
+ * formatting
*/
public static NumberFormat getInstance(Locale inLocale) {
return getInstance(inLocale, NUMBERSTYLE);
@@ -413,6 +448,9 @@ public abstract class NumberFormat extends Format {
* This is equivalent to calling
* {@link #getNumberInstance(Locale)
* getNumberInstance(Locale.getDefault(Locale.Category.FORMAT))}.
+ *
+ * @return the {@code NumberFormat} instance for general-purpose number
+ * formatting
* @see java.util.Locale#getDefault(java.util.Locale.Category)
* @see java.util.Locale.Category#FORMAT
*/
@@ -422,6 +460,10 @@ public abstract class NumberFormat extends Format {
/**
* Returns a general-purpose number format for the specified locale.
+ *
+ * @param inLocale the desired locale
+ * @return the {@code NumberFormat} instance for general-purpose number
+ * formatting
*/
public static NumberFormat getNumberInstance(Locale inLocale) {
return getInstance(inLocale, NUMBERSTYLE);
@@ -457,6 +499,7 @@ public abstract class NumberFormat extends Format {
* and to parse only the integer part of an input string (see {@link
* #isParseIntegerOnly isParseIntegerOnly}).
*
+ * @param inLocale the desired locale
* @see #getRoundingMode()
* @return a number format for integer values
* @since 1.4
@@ -472,6 +515,7 @@ public abstract class NumberFormat extends Format {
* {@link #getCurrencyInstance(Locale)
* getCurrencyInstance(Locale.getDefault(Locale.Category.FORMAT))}.
*
+ * @return the {@code NumberFormat} instance for currency formatting
* @see java.util.Locale#getDefault(java.util.Locale.Category)
* @see java.util.Locale.Category#FORMAT
*/
@@ -481,6 +525,9 @@ public abstract class NumberFormat extends Format {
/**
* Returns a currency format for the specified locale.
+ *
+ * @param inLocale the desired locale
+ * @return the {@code NumberFormat} instance for currency formatting
*/
public static NumberFormat getCurrencyInstance(Locale inLocale) {
return getInstance(inLocale, CURRENCYSTYLE);
@@ -493,6 +540,7 @@ public abstract class NumberFormat extends Format {
* {@link #getPercentInstance(Locale)
* getPercentInstance(Locale.getDefault(Locale.Category.FORMAT))}.
*
+ * @return the {@code NumberFormat} instance for percentage formatting
* @see java.util.Locale#getDefault(java.util.Locale.Category)
* @see java.util.Locale.Category#FORMAT
*/
@@ -502,6 +550,9 @@ public abstract class NumberFormat extends Format {
/**
* Returns a percentage format for the specified locale.
+ *
+ * @param inLocale the desired locale
+ * @return the {@code NumberFormat} instance for percentage formatting
*/
public static NumberFormat getPercentInstance(Locale inLocale) {
return getInstance(inLocale, PERCENTSTYLE);
@@ -516,6 +567,8 @@ public abstract class NumberFormat extends Format {
/**
* Returns a scientific format for the specified locale.
+ *
+ * @param inLocale the desired locale
*/
/*public*/ static NumberFormat getScientificInstance(Locale inLocale) {
return getInstance(inLocale, SCIENTIFICSTYLE);
@@ -586,6 +639,9 @@ public abstract class NumberFormat extends Format {
* English locale, with grouping on, the number 1234567 might be formatted
* as "1,234,567". The grouping separator as well as the size of each group
* is locale dependant and is determined by sub-classes of NumberFormat.
+ *
+ * @return {@code true} if grouping is used;
+ * {@code false} otherwise
* @see #setGroupingUsed
*/
public boolean isGroupingUsed() {
@@ -594,6 +650,9 @@ public abstract class NumberFormat extends Format {
/**
* Set whether or not grouping will be used in this format.
+ *
+ * @param newValue {@code true} if grouping is used;
+ * {@code false} otherwise
* @see #isGroupingUsed
*/
public void setGroupingUsed(boolean newValue) {
@@ -603,6 +662,8 @@ public abstract class NumberFormat extends Format {
/**
* Returns the maximum number of digits allowed in the integer portion of a
* number.
+ *
+ * @return the maximum number of digits
* @see #setMaximumIntegerDigits
*/
public int getMaximumIntegerDigits() {
@@ -611,10 +672,11 @@ public abstract class NumberFormat extends Format {
/**
* Sets the maximum number of digits allowed in the integer portion of a
- * number. maximumIntegerDigits must be >= minimumIntegerDigits. If the
+ * number. maximumIntegerDigits must be ≥ minimumIntegerDigits. If the
* new value for maximumIntegerDigits is less than the current value
* of minimumIntegerDigits, then minimumIntegerDigits will also be set to
* the new value.
+ *
* @param newValue the maximum number of integer digits to be shown; if
* less than zero, then zero is used. The concrete subclass may enforce an
* upper limit to this value appropriate to the numeric type being formatted.
@@ -630,6 +692,8 @@ public abstract class NumberFormat extends Format {
/**
* Returns the minimum number of digits allowed in the integer portion of a
* number.
+ *
+ * @return the minimum number of digits
* @see #setMinimumIntegerDigits
*/
public int getMinimumIntegerDigits() {
@@ -638,10 +702,11 @@ public abstract class NumberFormat extends Format {
/**
* Sets the minimum number of digits allowed in the integer portion of a
- * number. minimumIntegerDigits must be <= maximumIntegerDigits. If the
+ * number. minimumIntegerDigits must be ≤ maximumIntegerDigits. If the
* new value for minimumIntegerDigits exceeds the current value
* of maximumIntegerDigits, then maximumIntegerDigits will also be set to
* the new value
+ *
* @param newValue the minimum number of integer digits to be shown; if
* less than zero, then zero is used. The concrete subclass may enforce an
* upper limit to this value appropriate to the numeric type being formatted.
@@ -657,6 +722,8 @@ public abstract class NumberFormat extends Format {
/**
* Returns the maximum number of digits allowed in the fraction portion of a
* number.
+ *
+ * @return the maximum number of digits.
* @see #setMaximumFractionDigits
*/
public int getMaximumFractionDigits() {
@@ -665,10 +732,11 @@ public abstract class NumberFormat extends Format {
/**
* Sets the maximum number of digits allowed in the fraction portion of a
- * number. maximumFractionDigits must be >= minimumFractionDigits. If the
+ * number. maximumFractionDigits must be ≥ minimumFractionDigits. If the
* new value for maximumFractionDigits is less than the current value
* of minimumFractionDigits, then minimumFractionDigits will also be set to
* the new value.
+ *
* @param newValue the maximum number of fraction digits to be shown; if
* less than zero, then zero is used. The concrete subclass may enforce an
* upper limit to this value appropriate to the numeric type being formatted.
@@ -684,6 +752,8 @@ public abstract class NumberFormat extends Format {
/**
* Returns the minimum number of digits allowed in the fraction portion of a
* number.
+ *
+ * @return the minimum number of digits
* @see #setMinimumFractionDigits
*/
public int getMinimumFractionDigits() {
@@ -692,10 +762,11 @@ public abstract class NumberFormat extends Format {
/**
* Sets the minimum number of digits allowed in the fraction portion of a
- * number. minimumFractionDigits must be <= maximumFractionDigits. If the
+ * number. minimumFractionDigits must be ≤ maximumFractionDigits. If the
* new value for minimumFractionDigits exceeds the current value
* of maximumFractionDigits, then maximumIntegerDigits will also be set to
* the new value
+ *
* @param newValue the minimum number of fraction digits to be shown; if
* less than zero, then zero is used. The concrete subclass may enforce an
* upper limit to this value appropriate to the numeric type being formatted.
diff --git a/src/share/classes/java/text/ParseException.java b/src/share/classes/java/text/ParseException.java
index a274e7e69fd26cfc61c2b9ec303d3d1b97385d35..f9ad001fa5219e044314759cd931d4cfe77dfb84 100644
--- a/src/share/classes/java/text/ParseException.java
+++ b/src/share/classes/java/text/ParseException.java
@@ -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
@@ -55,6 +55,7 @@ class ParseException extends Exception {
* Constructs a ParseException with the specified detail message and
* offset.
* A detail message is a String that describes this particular exception.
+ *
* @param s the detail message
* @param errorOffset the position where the error is found while parsing.
*/
@@ -65,6 +66,8 @@ class ParseException extends Exception {
/**
* Returns the position where the error was found.
+ *
+ * @return the position where the error was found
*/
public int getErrorOffset () {
return errorOffset;
diff --git a/src/share/classes/java/text/ParsePosition.java b/src/share/classes/java/text/ParsePosition.java
index a187bb8a73a6fe068e23af0f7a15a093f6e24a2d..be3ffce61eb350ca647da639122619df22580685 100644
--- a/src/share/classes/java/text/ParsePosition.java
+++ b/src/share/classes/java/text/ParsePosition.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2002, 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
@@ -69,6 +69,8 @@ public class ParsePosition {
* Retrieve the current parse position. On input to a parse method, this
* is the index of the character at which parsing will begin; on output, it
* is the index of the character following the last character parsed.
+ *
+ * @return the current parse position
*/
public int getIndex() {
return index;
@@ -76,6 +78,8 @@ public class ParsePosition {
/**
* Set the current parse position.
+ *
+ * @param index the current parse position
*/
public void setIndex(int index) {
this.index = index;
@@ -83,6 +87,8 @@ public class ParsePosition {
/**
* Create a new ParsePosition with the given initial index.
+ *
+ * @param index initial index
*/
public ParsePosition(int index) {
this.index = index;
@@ -91,6 +97,8 @@ public class ParsePosition {
* Set the index at which a parse error occurred. Formatters
* should set this before returning an error code from their
* parseObject method. The default value is -1 if this is not set.
+ *
+ * @param ei the index at which an error occurred
* @since 1.2
*/
public void setErrorIndex(int ei)
@@ -101,12 +109,15 @@ public class ParsePosition {
/**
* Retrieve the index at which an error occurred, or -1 if the
* error index has not been set.
+ *
+ * @return the index at which an error occurred
* @since 1.2
*/
public int getErrorIndex()
{
return errorIndex;
}
+
/**
* Overrides equals
*/
diff --git a/src/share/classes/java/text/RuleBasedCollator.java b/src/share/classes/java/text/RuleBasedCollator.java
index ef32cc64ef23bc5a4a31c255769c1125889c1d3b..a99c0f757ebe504c243757bb7ceb52baf7568709 100644
--- a/src/share/classes/java/text/RuleBasedCollator.java
+++ b/src/share/classes/java/text/RuleBasedCollator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -68,17 +68,17 @@ import java.util.Locale;
* <reset> <text-argument>
*
* The definitions of the rule elements is as follows:
- *
+ *
* - Text-Argument: A text-argument is any sequence of
* characters, excluding special characters (that is, common
* whitespace characters [0009-000D, 0020] and rule syntax characters
* [0021-002F, 003A-0040, 005B-0060, 007B-007E]). If those
* characters are desired, you can put them in single quotes
- * (e.g. ampersand => '&'). Note that unquoted white space characters
+ * (e.g. ampersand => '&'). Note that unquoted white space characters
* are ignored; e.g.
b c is treated as bc.
* - Modifier: There are currently two modifiers that
* turn on special collation rules.
- *
+ *
* - '@' : Turns on backwards sorting of accents (secondary
* differences), as in French.
*
- '!' : Turns on Thai/Lao vowel-consonant swapping. If this
@@ -91,7 +91,7 @@ import java.util.Locale;
*
* '@' : Indicates that accents are sorted backwards, as in French.
* - Relation: The relations are the following:
- *
|
|