All Implemented Interfaces:
Closeable, AutoCloseable, Iterator<String>

  • Constructor Summary

    Constructors

    Constructs a new Scanner that produces values scanned from the specified file.

    Constructs a new Scanner that produces values scanned from the specified file.

    Constructs a new Scanner that produces values scanned from the specified file.

    Constructs a new Scanner that produces values scanned from the specified input stream.

    Constructs a new Scanner that produces values scanned from the specified input stream.

    Constructs a new Scanner that produces values scanned from the specified input stream.

    Constructs a new Scanner that produces values scanned from the specified source.

    Constructs a new Scanner that produces values scanned from the specified string.

    Constructs a new Scanner that produces values scanned from the specified channel.

    Constructs a new Scanner that produces values scanned from the specified channel.

    Constructs a new Scanner that produces values scanned from the specified channel.

    Constructs a new Scanner that produces values scanned from the specified file.

    Constructs a new Scanner that produces values scanned from the specified file.

    Constructs a new Scanner that produces values scanned from the specified file.

  • Method Summary

    void

    close()

    delimiter()

    Returns the Pattern this Scanner is currently using to match delimiters.

    Returns a stream of match results that match the provided pattern string.

    Returns a stream of match results from this scanner.

    Attempts to find the next occurrence of a pattern constructed from the specified string, ignoring delimiters.

    Attempts to find the next occurrence of the specified pattern ignoring delimiters.

    findWithinHorizon(String pattern, int horizon)

    Attempts to find the next occurrence of a pattern constructed from the specified string, ignoring delimiters.

    Attempts to find the next occurrence of the specified pattern.

    boolean

    hasNext()

    Returns true if this scanner has another token in its input.

    boolean

    Returns true if the next token matches the pattern constructed from the specified string.

    boolean

    Returns true if the next complete token matches the specified pattern.

    boolean

    Returns true if the next token in this scanner's input can be interpreted as a BigDecimal using the nextBigDecimal() method.

    boolean

    Returns true if the next token in this scanner's input can be interpreted as a BigInteger in the default radix using the nextBigInteger() method.

    boolean

    hasNextBigInteger(int radix)

    Returns true if the next token in this scanner's input can be interpreted as a BigInteger in the specified radix using the nextBigInteger() method.

    boolean

    Returns true if the next token in this scanner's input can be interpreted as a boolean value using a case insensitive pattern created from the string "true|false".

    boolean

    Returns true if the next token in this scanner's input can be interpreted as a byte value in the default radix using the nextByte() method.

    boolean

    hasNextByte(int radix)

    Returns true if the next token in this scanner's input can be interpreted as a byte value in the specified radix using the nextByte() method.

    boolean

    Returns true if the next token in this scanner's input can be interpreted as a double value using the nextDouble() method.

    boolean

    Returns true if the next token in this scanner's input can be interpreted as a float value using the nextFloat() method.

    boolean

    Returns true if the next token in this scanner's input can be interpreted as an int value in the default radix using the nextInt() method.

    boolean

    hasNextInt(int radix)

    Returns true if the next token in this scanner's input can be interpreted as an int value in the specified radix using the nextInt() method.

    boolean

    Returns true if there is another line in the input of this scanner.

    boolean

    Returns true if the next token in this scanner's input can be interpreted as a long value in the default radix using the nextLong() method.

    boolean

    hasNextLong(int radix)

    Returns true if the next token in this scanner's input can be interpreted as a long value in the specified radix using the nextLong() method.

    boolean

    Returns true if the next token in this scanner's input can be interpreted as a short value in the default radix using the nextShort() method.

    boolean

    hasNextShort(int radix)

    Returns true if the next token in this scanner's input can be interpreted as a short value in the specified radix using the nextShort() method.

    Returns the IOException last thrown by this Scanner's underlying Readable.

    locale()

    Returns this scanner's locale.

    match()

    Returns the match result of the last scanning operation performed by this scanner.

    next()

    Finds and returns the next complete token from this scanner.

    Returns the next token if it matches the pattern constructed from the specified string.

    Returns the next token if it matches the specified pattern.

    Scans the next token of the input as a BigDecimal.

    Scans the next token of the input as a BigInteger.

    nextBigInteger(int radix)

    Scans the next token of the input as a BigInteger.

    boolean

    Scans the next token of the input into a boolean value and returns that value.

    byte

    nextByte()

    Scans the next token of the input as a byte.

    byte

    nextByte(int radix)

    Scans the next token of the input as a byte.

    double

    Scans the next token of the input as a double.

    float

    nextFloat()

    Scans the next token of the input as a float.

    int

    nextInt()

    Scans the next token of the input as an int.

    int

    nextInt(int radix)

    Scans the next token of the input as an int.

    nextLine()

    Advances this scanner past the current line and returns the input that was skipped.

    long

    nextLong()

    Scans the next token of the input as a long.

    long

    nextLong(int radix)

    Scans the next token of the input as a long.

    short

    nextShort()

    Scans the next token of the input as a short.

    short

    nextShort(int radix)

    Scans the next token of the input as a short.

    int

    radix()

    Returns this scanner's default radix.

    void

    remove()

    The remove operation is not supported by this implementation of Iterator.

    reset()

    Skips input that matches a pattern constructed from the specified string.

    Skips input that matches the specified pattern, ignoring delimiters.

    tokens()

    Returns a stream of delimiter-separated tokens from this scanner.

    toString()

    Returns the string representation of this Scanner.

    Sets this scanner's delimiting pattern to a pattern constructed from the specified String.

    Sets this scanner's delimiting pattern to the specified pattern.

    Sets this scanner's locale to the specified locale.

    useRadix(int radix)

    Sets this scanner's default radix to the specified radix.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Creates and returns a copy of this object.

    boolean

    Indicates whether some other object is "equal to" this one.

    protected void

    Deprecated, for removal: This API element is subject to removal in a future version.

    Returns the runtime class of this Object.

    int

    Returns a hash code value for this object.

    final void

    Wakes up a single thread that is waiting on this object's monitor.

    final void

    Wakes up all threads that are waiting on this object's monitor.

    final void

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

    final void

    wait(long timeoutMillis)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

    final void

    wait(long timeoutMillis, int nanos)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

    Methods declared in interface Iterator

    forEachRemaining

    default void

    Performs the given action for each remaining element until all elements have been processed or the action throws an exception.

  • Constructor Details

    • Scanner

    • Scanner

    • Scanner

    • Scanner

    • Scanner

    • Scanner

    • Scanner

    • Scanner

    • Scanner

    • Scanner

    • Scanner

    • Scanner

    • Scanner

    • Scanner

  • Method Details

    • close

    • ioException

    • delimiter

    • useDelimiter

    • useDelimiter

    • locale

    • useLocale

    • radix

    • useRadix

    • match

    • toString

    • hasNext

    • next

    • remove

    • hasNext

    • next

    • hasNext

    • next

    • hasNextLine

    • nextLine

    • findInLine

    • findInLine

    • findWithinHorizon

    • findWithinHorizon

    • skip

    • skip

    • hasNextBoolean

    • nextBoolean

    • hasNextByte

    • hasNextByte

    • nextByte

    • nextByte

    • hasNextShort

    • hasNextShort

    • nextShort

    • nextShort

    • hasNextInt

    • hasNextInt

    • nextInt

    • nextInt

    • hasNextLong

    • hasNextLong

    • nextLong

    • nextLong

    • hasNextFloat

    • nextFloat

    • hasNextDouble

    • nextDouble

    • hasNextBigInteger

    • hasNextBigInteger

    • nextBigInteger

    • nextBigInteger

    • hasNextBigDecimal

    • nextBigDecimal

    • reset

    • tokens

    • findAll

    • findAll