src/share/classes/java/util/Scanner.java
Print this page
rev 7727 : 8020539: Clean up doclint problems in java.util package, part 2
Summary: Clean up doclint errors and warnings in classes in java.util
Reviewed-by: darcy,chegar
Contributed-by: Brian Burkhalter <brian.burkhalter@oracle.com>
*** 74,84 ****
* System.out.println(s.next());
* s.close();
* }</pre></blockquote>
* <p>
* prints the following output:
! * <blockqjote><pre>{@code
* 1
* 2
* red
* blue
* }</pre></blockquote>
--- 74,84 ----
* System.out.println(s.next());
* s.close();
* }</pre></blockquote>
* <p>
* prints the following output:
! * <blockquote><pre>{@code
* 1
* 2
* red
* blue
* }</pre></blockquote>
*** 147,158 ****
* <p>A scanner will default to interpreting numbers as decimal unless a
* different radix has been set by using the {@link #useRadix} method. The
* {@link #reset} method will reset the value of the scanner's radix to
* <code>10</code> regardless of whether it was previously changed.
*
! * <a name="localized-numbers">
! * <h4> Localized numbers </h4>
*
* <p> An instance of this class is capable of scanning numbers in the standard
* formats as well as in the formats of the scanner's locale. A scanner's
* <a name="initial-locale">initial locale </a>is the value returned by the {@link
* java.util.Locale#getDefault(Locale.Category)
--- 147,157 ----
* <p>A scanner will default to interpreting numbers as decimal unless a
* different radix has been set by using the {@link #useRadix} method. The
* {@link #reset} method will reset the value of the scanner's radix to
* <code>10</code> regardless of whether it was previously changed.
*
! * <h3> <a name="localized-numbers">Localized numbers</a> </h3>
*
* <p> An instance of this class is capable of scanning numbers in the standard
* formats as well as in the formats of the scanner's locale. A scanner's
* <a name="initial-locale">initial locale </a>is the value returned by the {@link
* java.util.Locale#getDefault(Locale.Category)
*** 165,354 ****
* which for a particular locale are taken from that locale's {@link
* java.text.DecimalFormat DecimalFormat} object, <tt>df</tt>, and its and
* {@link java.text.DecimalFormatSymbols DecimalFormatSymbols} object,
* <tt>dfs</tt>.
*
! * <blockquote><table>
! * <tr><td valign="top"><i>LocalGroupSeparator </i></td>
! * <td valign="top">The character used to separate thousands groups,
* <i>i.e.,</i> <tt>dfs.</tt>{@link
* java.text.DecimalFormatSymbols#getGroupingSeparator
! * getGroupingSeparator()}</td></tr>
! * <tr><td valign="top"><i>LocalDecimalSeparator </i></td>
! * <td valign="top">The character used for the decimal point,
* <i>i.e.,</i> <tt>dfs.</tt>{@link
* java.text.DecimalFormatSymbols#getDecimalSeparator
! * getDecimalSeparator()}</td></tr>
! * <tr><td valign="top"><i>LocalPositivePrefix </i></td>
! * <td valign="top">The string that appears before a positive number (may
* be empty), <i>i.e.,</i> <tt>df.</tt>{@link
* java.text.DecimalFormat#getPositivePrefix
! * getPositivePrefix()}</td></tr>
! * <tr><td valign="top"><i>LocalPositiveSuffix </i></td>
! * <td valign="top">The string that appears after a positive number (may be
* empty), <i>i.e.,</i> <tt>df.</tt>{@link
* java.text.DecimalFormat#getPositiveSuffix
! * getPositiveSuffix()}</td></tr>
! * <tr><td valign="top"><i>LocalNegativePrefix </i></td>
! * <td valign="top">The string that appears before a negative number (may
* be empty), <i>i.e.,</i> <tt>df.</tt>{@link
* java.text.DecimalFormat#getNegativePrefix
! * getNegativePrefix()}</td></tr>
! * <tr><td valign="top"><i>LocalNegativeSuffix </i></td>
! * <td valign="top">The string that appears after a negative number (may be
* empty), <i>i.e.,</i> <tt>df.</tt>{@link
* java.text.DecimalFormat#getNegativeSuffix
! * getNegativeSuffix()}</td></tr>
! * <tr><td valign="top"><i>LocalNaN </i></td>
! * <td valign="top">The string that represents not-a-number for
* floating-point values,
* <i>i.e.,</i> <tt>dfs.</tt>{@link
* java.text.DecimalFormatSymbols#getNaN
! * getNaN()}</td></tr>
! * <tr><td valign="top"><i>LocalInfinity </i></td>
! * <td valign="top">The string that represents infinity for floating-point
* values, <i>i.e.,</i> <tt>dfs.</tt>{@link
* java.text.DecimalFormatSymbols#getInfinity
! * getInfinity()}</td></tr>
! * </table></blockquote>
*
! * <a name="number-syntax">
! * <h4> Number syntax </h4>
*
* <p> The strings that can be parsed as numbers by an instance of this class
* are specified in terms of the following regular-expression grammar, where
! * Rmax is the highest digit in the radix being used (for example, Rmax is 9
! * in base 10).
*
* <p>
! * <table cellspacing=0 cellpadding=0 align=center>
! *
! * <tr><td valign=top align=right><i>NonASCIIDigit</i> ::</td>
! * <td valign=top>= A non-ASCII character c for which
* {@link java.lang.Character#isDigit Character.isDigit}<tt>(c)</tt>
! * returns true</td></tr>
! *
! * <tr><td> </td></tr>
*
! * <tr><td align=right><i>Non0Digit</i> ::</td>
! * <td><tt>= [1-</tt><i>Rmax</i><tt>] | </tt><i>NonASCIIDigit</i></td></tr>
*
! * <tr><td> </td></tr>
*
! * <tr><td align=right><i>Digit</i> ::</td>
! * <td><tt>= [0-</tt><i>Rmax</i><tt>] | </tt><i>NonASCIIDigit</i></td></tr>
! *
! * <tr><td> </td></tr>
! *
! * <tr><td valign=top align=right><i>GroupedNumeral</i> ::</td>
! * <td valign=top>
! * <table cellpadding=0 cellspacing=0>
! * <tr><td><tt>= ( </tt></td>
! * <td><i>Non0Digit</i><tt>
! * </tt><i>Digit</i><tt>?
! * </tt><i>Digit</i><tt>?</tt></td></tr>
! * <tr><td></td>
! * <td><tt>( </tt><i>LocalGroupSeparator</i><tt>
! * </tt><i>Digit</i><tt>
! * </tt><i>Digit</i><tt>
! * </tt><i>Digit</i><tt> )+ )</tt></td></tr>
! * </table></td></tr>
! *
! * <tr><td> </td></tr>
! *
! * <tr><td align=right><i>Numeral</i> ::</td>
! * <td><tt>= ( ( </tt><i>Digit</i><tt>+ )
! * | </tt><i>GroupedNumeral</i><tt> )</tt></td></tr>
! *
! * <tr><td> </td></tr>
! *
! * <tr><td valign=top align=right>
! * <a name="Integer-regex"><i>Integer</i> ::</td>
! * <td valign=top><tt>= ( [-+]? ( </tt><i>Numeral</i><tt>
! * ) )</tt></td></tr>
! * <tr><td></td>
! * <td><tt>| </tt><i>LocalPositivePrefix</i><tt> </tt><i>Numeral</i><tt>
! * </tt><i>LocalPositiveSuffix</i></td></tr>
! * <tr><td></td>
! * <td><tt>| </tt><i>LocalNegativePrefix</i><tt> </tt><i>Numeral</i><tt>
! * </tt><i>LocalNegativeSuffix</i></td></tr>
! *
! * <tr><td> </td></tr>
! *
! * <tr><td align=right><i>DecimalNumeral</i> ::</td>
! * <td><tt>= </tt><i>Numeral</i></td></tr>
! * <tr><td></td>
! * <td><tt>| </tt><i>Numeral</i><tt>
! * </tt><i>LocalDecimalSeparator</i><tt>
! * </tt><i>Digit</i><tt>*</tt></td></tr>
! * <tr><td></td>
! * <td><tt>| </tt><i>LocalDecimalSeparator</i><tt>
! * </tt><i>Digit</i><tt>+</tt></td></tr>
! *
! * <tr><td> </td></tr>
! *
! * <tr><td align=right><i>Exponent</i> ::</td>
! * <td><tt>= ( [eE] [+-]? </tt><i>Digit</i><tt>+ )</tt></td></tr>
! *
! * <tr><td> </td></tr>
! *
! * <tr><td align=right>
! * <a name="Decimal-regex"><i>Decimal</i> ::</td>
! * <td><tt>= ( [-+]? </tt><i>DecimalNumeral</i><tt>
! * </tt><i>Exponent</i><tt>? )</tt></td></tr>
! * <tr><td></td>
! * <td><tt>| </tt><i>LocalPositivePrefix</i><tt>
! * </tt><i>DecimalNumeral</i><tt>
! * </tt><i>LocalPositiveSuffix</i>
! * </tt><i>Exponent</i><tt>?</td></tr>
! * <tr><td></td>
! * <td><tt>| </tt><i>LocalNegativePrefix</i><tt>
! * </tt><i>DecimalNumeral</i><tt>
! * </tt><i>LocalNegativeSuffix</i>
! * </tt><i>Exponent</i><tt>?</td></tr>
! *
! * <tr><td> </td></tr>
! *
! * <tr><td align=right><i>HexFloat</i> ::</td>
! * <td><tt>= [-+]? 0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+
! * ([pP][-+]?[0-9]+)?</tt></td></tr>
*
! * <tr><td> </td></tr>
! *
! * <tr><td align=right><i>NonNumber</i> ::</td>
! * <td valign=top><tt>= NaN
* | </tt><i>LocalNan</i><tt>
* | Infinity
! * | </tt><i>LocalInfinity</i></td></tr>
! *
! * <tr><td> </td></tr>
! *
! * <tr><td align=right><i>SignedNonNumber</i> ::</td>
! * <td><tt>= ( [-+]? </tt><i>NonNumber</i><tt> )</tt></td></tr>
! * <tr><td></td>
! * <td><tt>| </tt><i>LocalPositivePrefix</i><tt>
! * </tt><i>NonNumber</i><tt>
! * </tt><i>LocalPositiveSuffix</i></td></tr>
! * <tr><td></td>
! * <td><tt>| </tt><i>LocalNegativePrefix</i><tt>
! * </tt><i>NonNumber</i><tt>
! * </tt><i>LocalNegativeSuffix</i></td></tr>
! *
! * <tr><td> </td></tr>
! *
! * <tr><td valign=top align=right>
! * <a name="Float-regex"><i>Float</i> ::</td>
! * <td valign=top><tt>= </tt><i>Decimal</i><tt></td></tr>
! * <tr><td></td>
! * <td><tt>| </tt><i>HexFloat</i><tt></td></tr>
! * <tr><td></td>
! * <td><tt>| </tt><i>SignedNonNumber</i><tt></td></tr>
*
! * </table>
! * </center>
*
! * <p> Whitespace is not significant in the above regular expressions.
*
* @since 1.5
*/
public final class Scanner implements Iterator<String>, Closeable {
--- 164,306 ----
* which for a particular locale are taken from that locale's {@link
* java.text.DecimalFormat DecimalFormat} object, <tt>df</tt>, and its and
* {@link java.text.DecimalFormatSymbols DecimalFormatSymbols} object,
* <tt>dfs</tt>.
*
! * <blockquote><dl>
! * <dt><i>LocalGroupSeparator </i>
! * <dd>The character used to separate thousands groups,
* <i>i.e.,</i> <tt>dfs.</tt>{@link
* java.text.DecimalFormatSymbols#getGroupingSeparator
! * getGroupingSeparator()}
! * <dt><i>LocalDecimalSeparator </i>
! * <dd>The character used for the decimal point,
* <i>i.e.,</i> <tt>dfs.</tt>{@link
* java.text.DecimalFormatSymbols#getDecimalSeparator
! * getDecimalSeparator()}
! * <dt><i>LocalPositivePrefix </i>
! * <dd>The string that appears before a positive number (may
* be empty), <i>i.e.,</i> <tt>df.</tt>{@link
* java.text.DecimalFormat#getPositivePrefix
! * getPositivePrefix()}
! * <dt><i>LocalPositiveSuffix </i>
! * <dd>The string that appears after a positive number (may be
* empty), <i>i.e.,</i> <tt>df.</tt>{@link
* java.text.DecimalFormat#getPositiveSuffix
! * getPositiveSuffix()}
! * <dt><i>LocalNegativePrefix </i>
! * <dd>The string that appears before a negative number (may
* be empty), <i>i.e.,</i> <tt>df.</tt>{@link
* java.text.DecimalFormat#getNegativePrefix
! * getNegativePrefix()}
! * <dt><i>LocalNegativeSuffix </i>
! * <dd>The string that appears after a negative number (may be
* empty), <i>i.e.,</i> <tt>df.</tt>{@link
* java.text.DecimalFormat#getNegativeSuffix
! * getNegativeSuffix()}
! * <dt><i>LocalNaN </i>
! * <dd>The string that represents not-a-number for
* floating-point values,
* <i>i.e.,</i> <tt>dfs.</tt>{@link
* java.text.DecimalFormatSymbols#getNaN
! * getNaN()}
! * <dt><i>LocalInfinity </i>
! * <dd>The string that represents infinity for floating-point
* values, <i>i.e.,</i> <tt>dfs.</tt>{@link
* java.text.DecimalFormatSymbols#getInfinity
! * getInfinity()}
! * </dl></blockquote>
*
! * <h4> <a name="number-syntax">Number syntax</a> </h4>
*
* <p> The strings that can be parsed as numbers by an instance of this class
* are specified in terms of the following regular-expression grammar, where
! * Rmax is the highest digit in the radix being used (for example, Rmax is 9 in base 10).
*
* <p>
! * <dl>
! * <dt><i>NonAsciiDigit</i>:
! * <dd>A non-ASCII character c for which
* {@link java.lang.Character#isDigit Character.isDigit}<tt>(c)</tt>
! * returns true
*
! * <dt><i>Non0Digit</i>:
! * <dd><tt>[1-</tt><i>Rmax</i><tt>] | </tt><i>NonASCIIDigit</i>
*
! * <dt><i>Digit</i>:
! * <dd><tt>[0-</tt><i>Rmax</i><tt>] | </tt><i>NonASCIIDigit</i>
*
! * <dt><i>GroupedNumeral</i>:
! * <dd><tt>( </tt><i>Non0Digit</i>
! * <i>Digit</i><tt>?
! * </tt><i>Digit</i><tt>?</tt>
! * <dd> <tt>( </tt><i>LocalGroupSeparator</i>
! * <i>Digit</i>
! * <i>Digit</i>
! * <i>Digit</i><tt> )+ )</tt>
! *
! * <dt><i>Numeral</i>:
! * <dd><tt>( ( </tt><i>Digit</i><tt>+ )
! * | </tt><i>GroupedNumeral</i><tt> )</tt>
! *
! * <dt><a name="Integer-regex"><i>Integer</i>:</a>
! * <dd><tt>( [-+]? ( </tt><i>Numeral</i><tt>
! * ) )</tt>
! * <dd><tt>| </tt><i>LocalPositivePrefix</i> <i>Numeral</i>
! * <i>LocalPositiveSuffix</i>
! * <dd><tt>| </tt><i>LocalNegativePrefix</i> <i>Numeral</i>
! * <i>LocalNegativeSuffix</i>
! *
! * <dt><i>DecimalNumeral</i>:
! * <dd><i>Numeral</i>
! * <dd><tt>| </tt><i>Numeral</i>
! * <i>LocalDecimalSeparator</i>
! * <i>Digit</i><tt>*</tt>
! * <dd><tt>| </tt><i>LocalDecimalSeparator</i>
! * <i>Digit</i><tt>+</tt>
! *
! * <dt><i>Exponent</i>:
! * <dd><tt>( [eE] [+-]? </tt><i>Digit</i><tt>+ )</tt>
! *
! * <dt><a name="Decimal-regex"><i>Decimal</i>:</a>
! * <dd><tt>( [-+]? </tt><i>DecimalNumeral</i>
! * <i>Exponent</i><tt>? )</tt>
! * <dd><tt>| </tt><i>LocalPositivePrefix</i>
! * <i>DecimalNumeral</i>
! * <i>LocalPositiveSuffix</i>
! * <i>Exponent</i><tt>?</tt>
! * <dd><tt>| </tt><i>LocalNegativePrefix</i>
! * <i>DecimalNumeral</i>
! * <i>LocalNegativeSuffix</i>
! * <i>Exponent</i><tt>?</tt>
! *
! * <dt><i>HexFloat</i>:
! * <dd><tt>[-+]? 0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+
! * ([pP][-+]?[0-9]+)?</tt>
*
! * <dt><i>NonNumber</i>:
! * <dd><tt>NaN
* | </tt><i>LocalNan</i><tt>
* | Infinity
! * | </tt><i>LocalInfinity</i>
*
! * <dt><i>SignedNonNumber</i>:
! * <dd><tt>( [-+]? </tt><i>NonNumber</i><tt> )</tt>
! * <dd><tt>| </tt><i>LocalPositivePrefix</i>
! * <i>NonNumber</i>
! * <i>LocalPositiveSuffix</i>
! * <dd><tt>| </tt><i>LocalNegativePrefix</i>
! * <i>NonNumber</i>
! * <i>LocalNegativeSuffix</i>
! *
! * <dt><a name="Float-regex"><i>Float</i></a>:
! * <dd><i>Decimal</i>
! * <tt>| </tt><i>HexFloat</i>
! * <tt>| </tt><i>SignedNonNumber</i>
*
! * </dl>
! * <p>Whitespace is not significant in the above regular expressions.
*
* @since 1.5
*/
public final class Scanner implements Iterator<String>, Closeable {
*** 1673,1682 ****
--- 1625,1635 ----
* <tt>findWithinHorizon(pattern)</tt> behaves in exactly the same way as
* the invocation
* <tt>findWithinHorizon(Pattern.compile(pattern, horizon))</tt>.
*
* @param pattern a string specifying the pattern to search for
+ * @param horizon the search horizon
* @return the text that matched the specified pattern
* @throws IllegalStateException if this scanner is closed
* @throws IllegalArgumentException if horizon is negative
*/
public String findWithinHorizon(String pattern, int horizon) {
*** 1707,1716 ****
--- 1660,1670 ----
*
* <p>If horizon is negative, then an IllegalArgumentException is
* thrown.
*
* @param pattern the pattern to scan for
+ * @param horizon the search horizon
* @return the text that matched the specified pattern
* @throws IllegalStateException if this scanner is closed
* @throws IllegalArgumentException if horizon is negative
*/
public String findWithinHorizon(Pattern pattern, int horizon) {