Scanner Scanner Class

Definition

A parser that parses a text string of primitive types and strings with the help of regular expressions.

[Android.Runtime.Register("java/util/Scanner", ApiSince=1, DoNotGenerateAcw=true)]
public sealed class Scanner : Java.Lang.Object, IDisposable, Java.IO.ICloseable, Java.Util.IIterator
type Scanner = class
    inherit Object
    interface ICloseable
    interface IJavaObject
    interface IDisposable
    interface IIterator
Inheritance
ScannerScanner
Attributes
Implements

Remarks

Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Scanner(File) Scanner(File)

Creates a Scanner with the specified File as input.

Scanner(File, String) Scanner(File, String)

Creates a Scanner with the specified File as input.

Scanner(IPath) Scanner(IPath)
Scanner(IPath, String) Scanner(IPath, String)
Scanner(IReadable) Scanner(IReadable)

Creates a Scanner with the specified Readable as input.

Scanner(IReadableByteChannel) Scanner(IReadableByteChannel)

Creates a Scanner with the specified ReadableByteChannel as input.

Scanner(IReadableByteChannel, String) Scanner(IReadableByteChannel, String)

Creates a Scanner with the specified ReadableByteChannel as input.

Scanner(Stream) Scanner(Stream)

Creates a Scanner on the specified InputStream.

Scanner(Stream, String) Scanner(Stream, String)

Creates a Scanner on the specified InputStream.

Scanner(String) Scanner(String)

Creates a Scanner on the specified string.

Properties

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasNext HasNext

Returns whether this Scanner has one or more tokens remaining to parse.

HasNextBigDecimal HasNextBigDecimal

Returns whether the next token can be translated into a valid BigDecimal.

HasNextBigInteger HasNextBigInteger

Returns whether the next token can be translated into a valid BigInteger in the default radix.

HasNextBoolean HasNextBoolean

Returns whether the next token can be translated into a valid boolean value.

HasNextByte HasNextByte

Returns whether the next token can be translated into a valid byte value in the default radix.

HasNextDouble HasNextDouble

Returns whether the next token translated into a valid double value.

HasNextFloat HasNextFloat

Returns whether the next token can be translated into a valid float value.

HasNextInt HasNextInt

Returns whether the next token can be translated into a valid int value in the default radix.

HasNextLine HasNextLine

Returns true if there is a line terminator in the input.

HasNextLong HasNextLong

Returns whether the next token can be translated into a valid long value in the default radix.

HasNextShort HasNextShort

Returns whether the next token can be translated into a valid short value in the default radix.

IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
PeerReference PeerReference Inherited from Object
ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
Close() Close()

Closes this Scanner and the underlying input if the input implements Closeable.

Delimiter() Delimiter()

Returns the delimiter Pattern in use by this Scanner.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
FindInLine(Pattern) FindInLine(Pattern)

Tries to find the pattern in the input.

FindInLine(String) FindInLine(String)

Compiles the pattern string and tries to find a substring matching it in the input data.

FindWithinHorizon(Pattern, Int32) FindWithinHorizon(Pattern, Int32)

Tries to find the pattern in the input between the current position and the specified horizon.

FindWithinHorizon(String, Int32) FindWithinHorizon(String, Int32)

Tries to find the pattern in the input between the current position and the specified horizon.

GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
InvokeHasNext(Pattern) InvokeHasNext(Pattern)

Returns whether this Scanner has one or more tokens remaining to parse and the next token matches the given pattern.

InvokeHasNext(String) InvokeHasNext(String)

Returns true if this Scanner has one or more tokens remaining to parse and the next token matches a pattern compiled from the given string.

InvokeHasNextBigInteger(Int32) InvokeHasNextBigInteger(Int32)

Returns whether the next token can be translated into a valid BigInteger in the specified radix.

InvokeHasNextByte(Int32) InvokeHasNextByte(Int32)

Returns whether the next token can be translated into a valid byte value in the specified radix.

InvokeHasNextInt(Int32) InvokeHasNextInt(Int32)

Returns whether the next token can be translated into a valid int value in the specified radix.

InvokeHasNextLong(Int32) InvokeHasNextLong(Int32)

Returns whether the next token can be translated into a valid long value in the specified radix.

InvokeHasNextShort(Int32) InvokeHasNextShort(Int32)

Returns whether the next token can be translated into a valid short value in the specified radix.

IoException() IoException()

Returns the last IOException that was raised while reading from the underlying input, or null if none was thrown.

JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Locale() Locale()

Returns the Locale of this Scanner.

Match() Match()

Returns the result of the last matching operation.

Next() Next()

Returns the next token.

Next(Pattern) Next(Pattern)

Returns the next token if it matches the specified pattern.

Next(String) Next(String)

Returns the next token if it matches the specified pattern.

NextBigDecimal() NextBigDecimal()

Returns the next token as a BigDecimal.

NextBigInteger() NextBigInteger()

Returns the next token as a BigInteger in the current radix.

NextBigInteger(Int32) NextBigInteger(Int32)

Returns the next token as a BigInteger with the specified radix.

NextBoolean() NextBoolean()

Returns the next token as a boolean.

NextByte() NextByte()

Returns the next token as a byte in the current radix.

NextByte(Int32) NextByte(Int32)

Returns the next token as a byte with the specified radix.

NextDouble() NextDouble()

Returns the next token as a double.

NextFloat() NextFloat()

Returns the next token as a float.

NextInt() NextInt()

Returns the next token as an int in the current radix.

NextInt(Int32) NextInt(Int32)

Returns the next token as an int with the specified radix.

NextLine() NextLine()

Returns the skipped input and advances the Scanner to the beginning of the next line.

NextLong() NextLong()

Returns the next token as a long in the current radix.

NextLong(Int32) NextLong(Int32)

Returns the next token as a long with the specified radix.

NextShort() NextShort()

Returns the next token as a short in the current radix.

NextShort(Int32) NextShort(Int32)

Returns the next token as a short with the specified radix.

Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
Radix() Radix()

Return the radix of this Scanner.

Remove() Remove()

Remove is not a supported operation on Scanner.

Reset() Reset()

Resets this scanner's delimiter, locale, and radix.

SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
Skip(Pattern) Skip(Pattern)

Tries to use specified pattern to match input starting from the current position.

Skip(String) Skip(String)

Tries to use the specified string to construct a pattern and then uses the constructed pattern to match input starting from the current position.

ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
UseDelimiter(Pattern) UseDelimiter(Pattern)

Sets the delimiting pattern of this Scanner.

UseDelimiter(String) UseDelimiter(String)

Sets the delimiting pattern of this Scanner with a pattern compiled from the supplied string value.

UseLocale(Locale) UseLocale(Locale)

Sets the Locale of this Scanner to a specified Locale.

UseRadix(Int32) UseRadix(Int32)

Sets the radix of this Scanner to the specified radix.

Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)

Explicit Interface Implementations

IIterator.Next() IIterator.Next()
IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to