--- old/src/java.base/share/classes/java/util/Scanner.java 2015-08-07 21:15:18.630584040 +0400 +++ new/src/java.base/share/classes/java/util/Scanner.java 2015-08-07 21:15:18.426584049 +0400 @@ -42,20 +42,20 @@ * A simple text scanner which can parse primitive types and strings using * regular expressions. * - *

A Scanner breaks its input into tokens using a + *

A {@code Scanner} breaks its input into tokens using a * delimiter pattern, which by default matches whitespace. The resulting * tokens may then be converted into values of different types using the - * various next methods. + * various {@code next} methods. * *

For example, this code allows a user to read a number from - * System.in: + * {@code System.in}: *

{@code
  *     Scanner sc = new Scanner(System.in);
  *     int i = sc.nextInt();
  * }
* - *

As another example, this code allows long types to be - * assigned from entries in a file myNumbers: + *

As another example, this code allows {@code long} types to be + * assigned from entries in a file {@code myNumbers}: *

{@code
  *      Scanner sc = new Scanner(new File("myNumbers"));
  *      while (sc.hasNextLong()) {
@@ -106,10 +106,10 @@
  * 

The {@link #next} and {@link #hasNext} methods and their * primitive-type companion methods (such as {@link #nextInt} and * {@link #hasNextInt}) first skip any input that matches the delimiter - * pattern, and then attempt to return the next token. Both hasNext - * and next methods may block waiting for further input. Whether a - * hasNext method blocks has no connection to whether or not its - * associated next method will block. + * pattern, and then attempt to return the next token. Both {@code hasNext} + * and {@code next} methods may block waiting for further input. Whether a + * {@code hasNext} method blocks has no connection to whether or not its + * associated {@code next} method will block. * *

The {@link #findInLine}, {@link #findWithinHorizon}, and {@link #skip} * methods operate independently of the delimiter pattern. These methods will @@ -122,32 +122,32 @@ * retrieved or skipped via some other method. * *

Depending upon the type of delimiting pattern, empty tokens may be - * returned. For example, the pattern "\\s+" will return no empty + * returned. For example, the pattern {@code "\\s+"} will return no empty * tokens since it matches multiple instances of the delimiter. The delimiting - * pattern "\\s" could return empty tokens since it only passes one + * pattern {@code "\\s"} could return empty tokens since it only passes one * space at a time. * *

A scanner can read text from any object which implements the {@link * java.lang.Readable} interface. If an invocation of the underlying * readable's {@link java.lang.Readable#read} method throws an {@link * java.io.IOException} then the scanner assumes that the end of the input - * has been reached. The most recent IOException thrown by the + * has been reached. The most recent {@code IOException} thrown by the * underlying readable can be retrieved via the {@link #ioException} method. * - *

When a Scanner is closed, it will close its input source + *

When a {@code Scanner} is closed, it will close its input source * if the source implements the {@link java.io.Closeable} interface. * - *

A Scanner is not safe for multithreaded use without + *

A {@code Scanner} is not safe for multithreaded use without * external synchronization. * - *

Unless otherwise mentioned, passing a null parameter into - * any method of a Scanner will cause a - * NullPointerException to be thrown. + *

Unless otherwise mentioned, passing a {@code null} parameter into + * any method of a {@code Scanner} will cause a + * {@code NullPointerException} to be thrown. * *

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 - * 10 regardless of whether it was previously changed. + * {@code 10} regardless of whether it was previously changed. * *

Localized numbers

* @@ -162,50 +162,50 @@ * *

The localized formats are defined in terms of the following parameters, * which for a particular locale are taken from that locale's {@link - * java.text.DecimalFormat DecimalFormat} object, df, and its and + * java.text.DecimalFormat DecimalFormat} object, {@code df}, and its and * {@link java.text.DecimalFormatSymbols DecimalFormatSymbols} object, - * dfs. + * {@code dfs}. * *

*
LocalGroupSeparator   *
The character used to separate thousands groups, - * i.e., dfs.{@link + * i.e., {@code dfs.}{@link * java.text.DecimalFormatSymbols#getGroupingSeparator * getGroupingSeparator()} *
LocalDecimalSeparator   *
The character used for the decimal point, - * i.e., dfs.{@link + * i.e., {@code dfs.}{@link * java.text.DecimalFormatSymbols#getDecimalSeparator * getDecimalSeparator()} *
LocalPositivePrefix   *
The string that appears before a positive number (may - * be empty), i.e., df.{@link + * be empty), i.e., {@code df.}{@link * java.text.DecimalFormat#getPositivePrefix * getPositivePrefix()} *
LocalPositiveSuffix   *
The string that appears after a positive number (may be - * empty), i.e., df.{@link + * empty), i.e., {@code df.}{@link * java.text.DecimalFormat#getPositiveSuffix * getPositiveSuffix()} *
LocalNegativePrefix   *
The string that appears before a negative number (may - * be empty), i.e., df.{@link + * be empty), i.e., {@code df.}{@link * java.text.DecimalFormat#getNegativePrefix * getNegativePrefix()} *
LocalNegativeSuffix   *
The string that appears after a negative number (may be - * empty), i.e., df.{@link + * empty), i.e., {@code df.}{@link * java.text.DecimalFormat#getNegativeSuffix * getNegativeSuffix()} *
LocalNaN   *
The string that represents not-a-number for * floating-point values, - * i.e., dfs.{@link + * i.e., {@code dfs.}{@link * java.text.DecimalFormatSymbols#getNaN * getNaN()} *
LocalInfinity   *
The string that represents infinity for floating-point - * values, i.e., dfs.{@link + * values, i.e., {@code dfs.}{@link * java.text.DecimalFormatSymbols#getInfinity * getInfinity()} *
@@ -219,82 +219,82 @@ *
*
NonAsciiDigit: *
A non-ASCII character c for which - * {@link java.lang.Character#isDigit Character.isDigit}(c) + * {@link java.lang.Character#isDigit Character.isDigit}{@code (c)} * returns true * *
Non0Digit: - *
[1-Rmax] | NonASCIIDigit + *
{@code [1-}Rmax{@code ] | }NonASCIIDigit * *
Digit: - *
[0-Rmax] | NonASCIIDigit + *
{@code [0-}Rmax{@code ] | }NonASCIIDigit * *
GroupedNumeral: - *
Non0Digit - * Digit? - * Digit? - *
    LocalGroupSeparator + *
Non0Digit + * Digit{@code ? + * }Digit{@code ?} + *
    LocalGroupSeparator * Digit * Digit - * Digit )+ ) + * Digit{@code )+ )} * *
Numeral: - *
( ( Digit+ ) - * | GroupedNumeral ) + *
{@code ( ( }Digit{@code + ) + * | }GroupedNumeral{@code )} * *
Integer: - *
( [-+]? ( Numeral - * ) ) - *
| LocalPositivePrefix Numeral + *
{@code ( [-+]? ( }Numeral{@code + * ) )} + *
{@code | }LocalPositivePrefix Numeral * LocalPositiveSuffix - *
| LocalNegativePrefix Numeral + *
{@code | }LocalNegativePrefix Numeral * LocalNegativeSuffix * *
DecimalNumeral: *
Numeral - *
| Numeral + *
{@code | }Numeral * LocalDecimalSeparator - * Digit* - *
| LocalDecimalSeparator - * Digit+ + * Digit{@code *} + *
{@code | }LocalDecimalSeparator + * Digit{@code +} * *
Exponent: - *
( [eE] [+-]? Digit+ ) + *
{@code ( [eE] [+-]? }Digit{@code + )} * *
Decimal: - *
( [-+]? DecimalNumeral - * Exponent? ) - *
| LocalPositivePrefix + *
{@code ( [-+]? }DecimalNumeral + * Exponent{@code ? )} + *
{@code | }LocalPositivePrefix * DecimalNumeral * LocalPositiveSuffix - * Exponent? - *
| LocalNegativePrefix + * Exponent{@code ?} + *
{@code | }LocalNegativePrefix * DecimalNumeral * LocalNegativeSuffix - * Exponent? + * Exponent{@code ?} * *
HexFloat: - *
[-+]? 0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+ - * ([pP][-+]?[0-9]+)? + *
{@code [-+]? 0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+ + * ([pP][-+]?[0-9]+)?} * *
NonNumber: - *
NaN - * | LocalNan + *
{@code NaN + * | }LocalNan{@code * | Infinity - * | LocalInfinity + * | }LocalInfinity * *
SignedNonNumber: - *
( [-+]? NonNumber ) - *
| LocalPositivePrefix + *
{@code ( [-+]? }NonNumber{@code )} + *
{@code | }LocalPositivePrefix * NonNumber * LocalPositiveSuffix - *
| LocalNegativePrefix + *
{@code | }LocalNegativePrefix * NonNumber * LocalNegativeSuffix * *
Float: *
Decimal - * | HexFloat - * | SignedNonNumber + * {@code | }HexFloat + * {@code | }SignedNonNumber * *
*

Whitespace is not significant in the above regular expressions. @@ -521,7 +521,7 @@ // Constructors /** - * Constructs a Scanner that returns values scanned + * Constructs a {@code Scanner} that returns values scanned * from the specified source delimited by the specified pattern. * * @param source A character source implementing the Readable interface @@ -541,7 +541,7 @@ } /** - * Constructs a new Scanner that produces values scanned + * Constructs a new {@code Scanner} that produces values scanned * from the specified source. * * @param source A character source implementing the {@link Readable} @@ -552,7 +552,7 @@ } /** - * Constructs a new Scanner that produces values scanned + * Constructs a new {@code Scanner} that produces values scanned * from the specified input stream. Bytes from the stream are converted * into characters using the underlying platform's * {@linkplain java.nio.charset.Charset#defaultCharset() default charset}. @@ -564,7 +564,7 @@ } /** - * Constructs a new Scanner that produces values scanned + * Constructs a new {@code Scanner} that produces values scanned * from the specified input stream. Bytes from the stream are converted * into characters using the specified charset. * @@ -599,7 +599,7 @@ } /** - * Constructs a new Scanner that produces values scanned + * Constructs a new {@code Scanner} that produces values scanned * from the specified file. Bytes from the file are converted into * characters using the underlying platform's * {@linkplain java.nio.charset.Charset#defaultCharset() default charset}. @@ -612,7 +612,7 @@ } /** - * Constructs a new Scanner that produces values scanned + * Constructs a new {@code Scanner} that produces values scanned * from the specified file. Bytes from the file are converted into * characters using the specified charset. * @@ -650,7 +650,7 @@ } /** - * Constructs a new Scanner that produces values scanned + * Constructs a new {@code Scanner} that produces values scanned * from the specified file. Bytes from the file are converted into * characters using the underlying platform's * {@linkplain java.nio.charset.Charset#defaultCharset() default charset}. @@ -669,7 +669,7 @@ } /** - * Constructs a new Scanner that produces values scanned + * Constructs a new {@code Scanner} that produces values scanned * from the specified file. Bytes from the file are converted into * characters using the specified charset. * @@ -693,7 +693,7 @@ } /** - * Constructs a new Scanner that produces values scanned + * Constructs a new {@code Scanner} that produces values scanned * from the specified string. * * @param source A string to scan @@ -703,7 +703,7 @@ } /** - * Constructs a new Scanner that produces values scanned + * Constructs a new {@code Scanner} that produces values scanned * from the specified channel. Bytes from the source are converted into * characters using the underlying platform's * {@linkplain java.nio.charset.Charset#defaultCharset() default charset}. @@ -720,7 +720,7 @@ } /** - * Constructs a new Scanner that produces values scanned + * Constructs a new {@code Scanner} that produces values scanned * from the specified channel. Bytes from the source are converted into * characters using the specified charset. * @@ -1077,7 +1077,7 @@ * *

If this scanner has not yet been closed then if its underlying * {@linkplain java.lang.Readable readable} also implements the {@link - * java.io.Closeable} interface then the readable's close method + * java.io.Closeable} interface then the readable's {@code close} method * will be invoked. If this scanner is already closed then invoking this * method will have no effect. * @@ -1101,9 +1101,9 @@ } /** - * Returns the IOException last thrown by this - * Scanner's underlying Readable. This method - * returns null if no such exception exists. + * Returns the {@code IOException} last thrown by this + * {@code Scanner}'s underlying {@code Readable}. This method + * returns {@code null} if no such exception exists. * * @return the last exception thrown by this scanner's readable */ @@ -1112,7 +1112,7 @@ } /** - * Returns the Pattern this Scanner is currently + * Returns the {@code Pattern} this {@code Scanner} is currently * using to match delimiters. * * @return this scanner's delimiting pattern. @@ -1134,11 +1134,11 @@ /** * Sets this scanner's delimiting pattern to a pattern constructed from - * the specified String. + * the specified {@code String}. * *

An invocation of this method of the form - * useDelimiter(pattern) behaves in exactly the same way as the - * invocation useDelimiter(Pattern.compile(pattern)). + * {@code useDelimiter(pattern)} behaves in exactly the same way as the + * invocation {@code useDelimiter(Pattern.compile(pattern))}. * *

Invoking the {@link #reset} method will set the scanner's delimiter * to the default. @@ -1236,12 +1236,12 @@ * number matching regular expressions; see * localized numbers above. * - *

If the radix is less than Character.MIN_RADIX - * or greater than Character.MAX_RADIX, then an - * IllegalArgumentException is thrown. + *

If the radix is less than {@code Character.MIN_RADIX} + * or greater than {@code Character.MAX_RADIX}, then an + * {@code IllegalArgumentException} is thrown. * *

Invoking the {@link #reset} method will set the scanner's radix to - * 10. + * {@code 10}. * * @param radix The radix to use when scanning numbers * @return this scanner @@ -1271,15 +1271,15 @@ /** * Returns the match result of the last scanning operation performed - * by this scanner. This method throws IllegalStateException + * by this scanner. This method throws {@code IllegalStateException} * if no match has been performed, or if the last match was * not successful. * - *

The various nextmethods of Scanner + *

The various {@code next}methods of {@code Scanner} * make a match result available if they complete without throwing an * exception. For instance, after an invocation of the {@link #nextInt} * method that returned an int, this method returns a - * MatchResult for the search of the + * {@code MatchResult} for the search of the * Integer regular expression * defined above. Similarly the {@link #findInLine}, * {@link #findWithinHorizon}, and {@link #skip} methods will make a @@ -1295,8 +1295,8 @@ } /** - *

Returns the string representation of this Scanner. The - * string representation of a Scanner contains information + *

Returns the string representation of this {@code Scanner}. The + * string representation of a {@code Scanner} contains information * that may be useful for debugging. The exact format is unspecified. * * @return The string representation of this scanner @@ -1347,7 +1347,7 @@ * A complete token is preceded and followed by input that matches * the delimiter pattern. This method may block while waiting for input * to scan, even if a previous invocation of {@link #hasNext} returned - * true. + * {@code true}. * * @return the next token * @throws NoSuchElementException if no more tokens are available @@ -1374,7 +1374,7 @@ /** * The remove operation is not supported by this implementation of - * Iterator. + * {@code Iterator}. * * @throws UnsupportedOperationException if this method is invoked. * @see java.util.Iterator @@ -1387,9 +1387,9 @@ * Returns true if the next token matches the pattern constructed from the * specified string. The scanner does not advance past any input. * - *

An invocation of this method of the form hasNext(pattern) + *

An invocation of this method of the form {@code hasNext(pattern)} * behaves in exactly the same way as the invocation - * hasNext(Pattern.compile(pattern)). + * {@code hasNext(Pattern.compile(pattern))}. * * @param pattern a string specifying the pattern to scan * @return true if and only if this scanner has another token matching @@ -1405,9 +1405,9 @@ * specified string. If the match is successful, the scanner advances * past the input that matched the pattern. * - *

An invocation of this method of the form next(pattern) + *

An invocation of this method of the form {@code next(pattern)} * behaves in exactly the same way as the invocation - * next(Pattern.compile(pattern)). + * {@code next(Pattern.compile(pattern))}. * * @param pattern a string specifying the pattern to scan * @return the next token @@ -1452,7 +1452,7 @@ /** * Returns the next token if it matches the specified pattern. This * method may block while waiting for input to scan, even if a previous - * invocation of {@link #hasNext(Pattern)} returned true. + * invocation of {@link #hasNext(Pattern)} returned {@code true}. * If the match is successful, the scanner advances past the input that * matched the pattern. * @@ -1554,9 +1554,9 @@ * Attempts to find the next occurrence of a pattern constructed from the * specified string, ignoring delimiters. * - *

An invocation of this method of the form findInLine(pattern) + *

An invocation of this method of the form {@code findInLine(pattern)} * behaves in exactly the same way as the invocation - * findInLine(Pattern.compile(pattern)). + * {@code findInLine(Pattern.compile(pattern))}. * * @param pattern a string specifying the pattern to search for * @return the text that matched the specified pattern @@ -1572,7 +1572,7 @@ * scanner advances past the input that matched and returns the string that * matched the pattern. * If no such pattern is detected in the input up to the next line - * separator, then null is returned and the scanner's + * separator, then {@code null} is returned and the scanner's * position is unchanged. This method may block waiting for input that * matches the pattern. * @@ -1621,9 +1621,9 @@ * specified string, ignoring delimiters. * *

An invocation of this method of the form - * findWithinHorizon(pattern) behaves in exactly the same way as + * {@code findWithinHorizon(pattern)} behaves in exactly the same way as * the invocation - * findWithinHorizon(Pattern.compile(pattern, horizon)). + * {@code findWithinHorizon(Pattern.compile(pattern, horizon))}. * * @param pattern a string specifying the pattern to search for * @param horizon the search horizon @@ -1645,14 +1645,14 @@ * null is returned and the scanner's position remains unchanged. This * method may block waiting for input that matches the pattern. * - *

A scanner will never search more than horizon code + *

A scanner will never search more than {@code horizon} code * points beyond its current position. Note that a match may be clipped * by the horizon; that is, an arbitrary match result may have been * different if the horizon had been larger. The scanner treats the * horizon as a transparent, non-anchoring bound (see {@link * Matcher#useTransparentBounds} and {@link Matcher#useAnchoringBounds}). * - *

If horizon is 0, then the horizon is ignored and + *

If horizon is {@code 0}, then the horizon is ignored and * this method continues to search through the input looking for the * specified pattern without bound. In this case it may buffer all of * the input searching for the pattern. @@ -1696,7 +1696,7 @@ * *

If a match to the specified pattern is not found at the * current position, then no input is skipped and a - * NoSuchElementException is thrown. + * {@code NoSuchElementException} is thrown. * *

Since this method seeks to match the specified pattern starting at * the scanner's current position, patterns that can match a lot of @@ -1704,8 +1704,8 @@ * amount of input. * *

Note that it is possible to skip something without risking a - * NoSuchElementException by using a pattern that can - * match nothing, e.g., sc.skip("[ \t]*"). + * {@code NoSuchElementException} by using a pattern that can + * match nothing, e.g., {@code sc.skip("[ \t]*")}. * * @param pattern a string specifying the pattern to skip over * @return this scanner @@ -1737,9 +1737,9 @@ * Skips input that matches a pattern constructed from the specified * string. * - *

An invocation of this method of the form skip(pattern) + *

An invocation of this method of the form {@code skip(pattern)} * behaves in exactly the same way as the invocation - * skip(Pattern.compile(pattern)). + * {@code skip(Pattern.compile(pattern))}. * * @param pattern a string specifying the pattern to skip over * @return this scanner @@ -1767,7 +1767,7 @@ /** * Scans the next token of the input into a boolean value and returns - * that value. This method will throw InputMismatchException + * that value. This method will throw {@code InputMismatchException} * if the next token cannot be translated into a valid boolean value. * If the match is successful, the scanner advances past the input that * matched. @@ -1822,14 +1822,14 @@ } /** - * Scans the next token of the input as a byte. + * Scans the next token of the input as a {@code byte}. * *

An invocation of this method of the form - * nextByte() behaves in exactly the same way as the - * invocation nextByte(radix), where radix + * {@code nextByte()} behaves in exactly the same way as the + * invocation {@code nextByte(radix)}, where {@code radix} * is the default radix of this scanner. * - * @return the byte scanned from the input + * @return the {@code byte} scanned from the input * @throws InputMismatchException * if the next token does not match the Integer * regular expression, or is out of range @@ -1841,15 +1841,15 @@ } /** - * Scans the next token of the input as a byte. - * This method will throw InputMismatchException + * Scans the next token of the input as a {@code byte}. + * This method will throw {@code InputMismatchException} * if the next token cannot be translated into a valid byte value as * described below. If the translation is successful, the scanner advances * past the input that matched. * *

If the next token matches the Integer regular expression defined - * above then the token is converted into a byte value as if by + * above then the token is converted into a {@code byte} value as if by * removing all locale specific prefixes, group separators, and locale * specific suffixes, then mapping non-ASCII digits into ASCII * digits via {@link Character#digit Character.digit}, prepending a @@ -1859,7 +1859,7 @@ * specified radix. * * @param radix the radix used to interpret the token as a byte value - * @return the byte scanned from the input + * @return the {@code byte} scanned from the input * @throws InputMismatchException * if the next token does not match the Integer * regular expression, or is out of range @@ -1928,14 +1928,14 @@ } /** - * Scans the next token of the input as a short. + * Scans the next token of the input as a {@code short}. * *

An invocation of this method of the form - * nextShort() behaves in exactly the same way as the - * invocation nextShort(radix), where radix + * {@code nextShort()} behaves in exactly the same way as the + * invocation {@code nextShort(radix)}, where {@code radix} * is the default radix of this scanner. * - * @return the short scanned from the input + * @return the {@code short} scanned from the input * @throws InputMismatchException * if the next token does not match the Integer * regular expression, or is out of range @@ -1947,15 +1947,15 @@ } /** - * Scans the next token of the input as a short. - * This method will throw InputMismatchException + * Scans the next token of the input as a {@code short}. + * This method will throw {@code InputMismatchException} * if the next token cannot be translated into a valid short value as * described below. If the translation is successful, the scanner advances * past the input that matched. * *

If the next token matches the Integer regular expression defined - * above then the token is converted into a short value as if by + * above then the token is converted into a {@code short} value as if by * removing all locale specific prefixes, group separators, and locale * specific suffixes, then mapping non-ASCII digits into ASCII * digits via {@link Character#digit Character.digit}, prepending a @@ -1965,7 +1965,7 @@ * specified radix. * * @param radix the radix used to interpret the token as a short value - * @return the short scanned from the input + * @return the {@code short} scanned from the input * @throws InputMismatchException * if the next token does not match the Integer * regular expression, or is out of range @@ -2058,14 +2058,14 @@ } /** - * Scans the next token of the input as an int. + * Scans the next token of the input as an {@code int}. * *

An invocation of this method of the form - * nextInt() behaves in exactly the same way as the - * invocation nextInt(radix), where radix + * {@code nextInt()} behaves in exactly the same way as the + * invocation {@code nextInt(radix)}, where {@code radix} * is the default radix of this scanner. * - * @return the int scanned from the input + * @return the {@code int} scanned from the input * @throws InputMismatchException * if the next token does not match the Integer * regular expression, or is out of range @@ -2077,15 +2077,15 @@ } /** - * Scans the next token of the input as an int. - * This method will throw InputMismatchException + * Scans the next token of the input as an {@code int}. + * This method will throw {@code InputMismatchException} * if the next token cannot be translated into a valid int value as * described below. If the translation is successful, the scanner advances * past the input that matched. * *

If the next token matches the Integer regular expression defined - * above then the token is converted into an int value as if by + * above then the token is converted into an {@code int} value as if by * removing all locale specific prefixes, group separators, and locale * specific suffixes, then mapping non-ASCII digits into ASCII * digits via {@link Character#digit Character.digit}, prepending a @@ -2095,7 +2095,7 @@ * specified radix. * * @param radix the radix used to interpret the token as an int value - * @return the int scanned from the input + * @return the {@code int} scanned from the input * @throws InputMismatchException * if the next token does not match the Integer * regular expression, or is out of range @@ -2164,14 +2164,14 @@ } /** - * Scans the next token of the input as a long. + * Scans the next token of the input as a {@code long}. * *

An invocation of this method of the form - * nextLong() behaves in exactly the same way as the - * invocation nextLong(radix), where radix + * {@code nextLong()} behaves in exactly the same way as the + * invocation {@code nextLong(radix)}, where {@code radix} * is the default radix of this scanner. * - * @return the long scanned from the input + * @return the {@code long} scanned from the input * @throws InputMismatchException * if the next token does not match the Integer * regular expression, or is out of range @@ -2183,15 +2183,15 @@ } /** - * Scans the next token of the input as a long. - * This method will throw InputMismatchException + * Scans the next token of the input as a {@code long}. + * This method will throw {@code InputMismatchException} * if the next token cannot be translated into a valid long value as * described below. If the translation is successful, the scanner advances * past the input that matched. * *

If the next token matches the Integer regular expression defined - * above then the token is converted into a long value as if by + * above then the token is converted into a {@code long} value as if by * removing all locale specific prefixes, group separators, and locale * specific suffixes, then mapping non-ASCII digits into ASCII * digits via {@link Character#digit Character.digit}, prepending a @@ -2201,7 +2201,7 @@ * specified radix. * * @param radix the radix used to interpret the token as an int value - * @return the long scanned from the input + * @return the {@code long} scanned from the input * @throws InputMismatchException * if the next token does not match the Integer * regular expression, or is out of range @@ -2306,15 +2306,15 @@ } /** - * Scans the next token of the input as a float. - * This method will throw InputMismatchException + * Scans the next token of the input as a {@code float}. + * This method will throw {@code InputMismatchException} * if the next token cannot be translated into a valid float value as * described below. If the translation is successful, the scanner advances * past the input that matched. * *

If the next token matches the Float regular expression defined above - * then the token is converted into a float value as if by + * then the token is converted into a {@code float} value as if by * removing all locale specific prefixes, group separators, and locale * specific suffixes, then mapping non-ASCII digits into ASCII * digits via {@link Character#digit Character.digit}, prepending a @@ -2325,7 +2325,7 @@ * is passed to {@link Float#parseFloat(String) Float.parseFloat} as * appropriate. * - * @return the float scanned from the input + * @return the {@code float} scanned from the input * @throws InputMismatchException * if the next token does not match the Float * regular expression, or is out of range @@ -2373,15 +2373,15 @@ } /** - * Scans the next token of the input as a double. - * This method will throw InputMismatchException + * Scans the next token of the input as a {@code double}. + * This method will throw {@code InputMismatchException} * if the next token cannot be translated into a valid double value. * If the translation is successful, the scanner advances past the input * that matched. * *

If the next token matches the Float regular expression defined above - * then the token is converted into a double value as if by + * then the token is converted into a {@code double} value as if by * removing all locale specific prefixes, group separators, and locale * specific suffixes, then mapping non-ASCII digits into ASCII * digits via {@link Character#digit Character.digit}, prepending a @@ -2392,7 +2392,7 @@ * is passed to {@link Double#parseDouble(String) Double.parseDouble} as * appropriate. * - * @return the double scanned from the input + * @return the {@code double} scanned from the input * @throws InputMismatchException * if the next token does not match the Float * regular expression, or is out of range @@ -2421,12 +2421,12 @@ /** * Returns true if the next token in this scanner's input can be - * interpreted as a BigInteger in the default radix using the + * interpreted as a {@code BigInteger} in the default radix using the * {@link #nextBigInteger} method. The scanner does not advance past any * input. * * @return true if and only if this scanner's next token is a valid - * BigInteger + * {@code BigInteger} * @throws IllegalStateException if this scanner is closed */ public boolean hasNextBigInteger() { @@ -2435,13 +2435,13 @@ /** * Returns true if the next token in this scanner's input can be - * interpreted as a BigInteger in the specified radix using + * interpreted as a {@code BigInteger} in the specified radix using * the {@link #nextBigInteger} method. The scanner does not advance past * any input. * * @param radix the radix used to interpret the token as an integer * @return true if and only if this scanner's next token is a valid - * BigInteger + * {@code BigInteger} * @throws IllegalStateException if this scanner is closed */ public boolean hasNextBigInteger(int radix) { @@ -2465,11 +2465,11 @@ * BigInteger}. * *

An invocation of this method of the form - * nextBigInteger() behaves in exactly the same way as the - * invocation nextBigInteger(radix), where radix + * {@code nextBigInteger()} behaves in exactly the same way as the + * invocation {@code nextBigInteger(radix)}, where {@code radix} * is the default radix of this scanner. * - * @return the BigInteger scanned from the input + * @return the {@code BigInteger} scanned from the input * @throws InputMismatchException * if the next token does not match the Integer * regular expression, or is out of range @@ -2486,7 +2486,7 @@ * *

If the next token matches the Integer regular expression defined - * above then the token is converted into a BigInteger value as if + * above then the token is converted into a {@code BigInteger} value as if * by removing all group separators, mapping non-ASCII digits into ASCII * digits via the {@link Character#digit Character.digit}, and passing the * resulting string to the {@link @@ -2494,7 +2494,7 @@ * BigInteger(String, int)} constructor with the specified radix. * * @param radix the radix used to interpret the token - * @return the BigInteger scanned from the input + * @return the {@code BigInteger} scanned from the input * @throws InputMismatchException * if the next token does not match the Integer * regular expression, or is out of range @@ -2525,12 +2525,12 @@ /** * Returns true if the next token in this scanner's input can be - * interpreted as a BigDecimal using the + * interpreted as a {@code BigDecimal} using the * {@link #nextBigDecimal} method. The scanner does not advance past any * input. * * @return true if and only if this scanner's next token is a valid - * BigDecimal + * {@code BigDecimal} * @throws IllegalStateException if this scanner is closed */ public boolean hasNextBigDecimal() { @@ -2553,14 +2553,14 @@ * *

If the next token matches the Decimal regular expression defined - * above then the token is converted into a BigDecimal value as if + * above then the token is converted into a {@code BigDecimal} value as if * by removing all group separators, mapping non-ASCII digits into ASCII * digits via the {@link Character#digit Character.digit}, and passing the * resulting string to the {@link * java.math.BigDecimal#BigDecimal(java.lang.String) BigDecimal(String)} * constructor. * - * @return the BigDecimal scanned from the input + * @return the {@code BigDecimal} scanned from the input * @throws InputMismatchException * if the next token does not match the Decimal * regular expression, or is out of range @@ -2594,7 +2594,7 @@ * #useDelimiter}, {@link #useLocale}, or {@link #useRadix}. * *

An invocation of this method of the form - * scanner.reset() behaves in exactly the same way as the + * {@code scanner.reset()} behaves in exactly the same way as the * invocation * *

{@code