Java java.util Scanner fields, constructors, methods, implement or subclass

Example usage for Java java.util Scanner fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.util Scanner.

The text is from its open source code.

Subclass

java.util.Scanner has subclasses.
Click this link to see all its subclasses.

Implementation

java.util.Scanner has the following implementations.
Click this link to see all its implementation.

Field

intradix
Localelocale

Constructor

Scanner(Readable source)
Constructs a new Scanner that produces values scanned from the specified source.
Scanner(InputStream source)
Constructs a new Scanner that produces values scanned from the specified input stream.
Scanner(File source)
Constructs a new Scanner that produces values scanned from the specified file.
Scanner(Path source)
Constructs a new Scanner that produces values scanned from the specified file.
Scanner(String source)
Constructs a new Scanner that produces values scanned from the specified string.
Scanner(ReadableByteChannel source)
Constructs a new Scanner that produces values scanned from the specified channel.
Scanner(Readable source, Pattern pattern)
Constructs a Scanner that returns values scanned from the specified source delimited by the specified pattern.
Scanner(InputStream source, String charsetName)
Constructs a new Scanner that produces values scanned from the specified input stream.
Scanner(InputStream source, Charset charset)
Constructs a new Scanner that produces values scanned from the specified input stream.
Scanner(File source, String charsetName)
Constructs a new Scanner that produces values scanned from the specified file.
Scanner(File source, Charset charset)
Constructs a new Scanner that produces values scanned from the specified file.
Scanner(File source, CharsetDecoder dec)
Scanner(Path source, String charsetName)
Constructs a new Scanner that produces values scanned from the specified file.
Scanner(Path source, Charset charset)
Constructs a new Scanner that produces values scanned from the specified file.
Scanner(ReadableByteChannel source, String charsetName)
Constructs a new Scanner that produces values scanned from the specified channel.
Scanner(ReadableByteChannel source, Charset charset)
Constructs a new Scanner that produces values scanned from the specified channel.

Method

voidclose()
Closes this scanner.
Patterndelimiter()
Returns the Pattern this Scanner is currently using to match delimiters.
StringfindInLine(String pattern)
Attempts to find the next occurrence of a pattern constructed from the specified string, ignoring delimiters.
StringfindInLine(Pattern pattern)
Attempts to find the next occurrence of the specified pattern ignoring delimiters.
StringfindWithinHorizon(String pattern, int horizon)
Attempts to find the next occurrence of a pattern constructed from the specified string, ignoring delimiters.
StringfindWithinHorizon(Pattern pattern, int horizon)
Attempts to find the next occurrence of the specified pattern.
ClassgetClass()
Returns the runtime class of this Object .
booleanhasNext()
Returns true if this scanner has another token in its input.
booleanhasNext(String pattern)
Returns true if the next token matches the pattern constructed from the specified string.
booleanhasNext(Pattern pattern)
Returns true if the next complete token matches the specified pattern.
booleanhasNextBigDecimal()
Returns true if the next token in this scanner's input can be interpreted as a BigDecimal using the #nextBigDecimal method.
booleanhasNextBigInteger()
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.
booleanhasNextBigInteger(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.
booleanhasNextBoolean()
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".
booleanhasNextByte()
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.
booleanhasNextByte(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.
booleanhasNextDouble()
Returns true if the next token in this scanner's input can be interpreted as a double value using the #nextDouble method.
booleanhasNextFloat()
Returns true if the next token in this scanner's input can be interpreted as a float value using the #nextFloat method.
booleanhasNextInt()
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.
booleanhasNextInt(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.
booleanhasNextLine()
Returns true if there is another line in the input of this scanner.
booleanhasNextLong()
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.
booleanhasNextLong(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.
booleanhasNextShort()
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.
booleanhasNextShort(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.
IOExceptionioException()
Returns the IOException last thrown by this Scanner 's underlying Readable .
MatchResultmatch()
Returns the match result of the last scanning operation performed by this scanner.
Stringnext()
Finds and returns the next complete token from this scanner.
Stringnext(String pattern)
Returns the next token if it matches the pattern constructed from the specified string.
Stringnext(Pattern pattern)
Returns the next token if it matches the specified pattern.
BigDecimalnextBigDecimal()
Scans the next token of the input as a java.math.BigDecimal BigDecimal .
BigIntegernextBigInteger(int radix)
Scans the next token of the input as a java.math.BigInteger BigInteger .
BigIntegernextBigInteger()
Scans the next token of the input as a java.math.BigInteger BigInteger .
booleannextBoolean()
Scans the next token of the input into a boolean value and returns that value.
bytenextByte()
Scans the next token of the input as a byte .
bytenextByte(int radix)
Scans the next token of the input as a byte .
doublenextDouble()
Scans the next token of the input as a double .
floatnextFloat()
Scans the next token of the input as a float .
intnextInt()
Scans the next token of the input as an int .
intnextInt(int radix)
Scans the next token of the input as an int .
StringnextLine()
Advances this scanner past the current line and returns the input that was skipped.
longnextLong(int radix)
Scans the next token of the input as a long .
longnextLong()
Scans the next token of the input as a long .
shortnextShort()
Scans the next token of the input as a short .
shortnextShort(int radix)
Scans the next token of the input as a short .
voidremove()
The remove operation is not supported by this implementation of Iterator .
Scannerreset()
Resets this scanner.
Scannerskip(Pattern pattern)
Skips input that matches the specified pattern, ignoring delimiters.
Scannerskip(String pattern)
Skips input that matches a pattern constructed from the specified string.
StringtoString()

Returns the string representation of this Scanner .

ScanneruseDelimiter(Pattern pattern)
Sets this scanner's delimiting pattern to the specified pattern.
ScanneruseDelimiter(String pattern)
Sets this scanner's delimiting pattern to a pattern constructed from the specified String .
ScanneruseLocale(Locale locale)
Sets this scanner's locale to the specified locale.
ScanneruseRadix(int radix)
Sets this scanner's default radix to the specified radix.