Java The Complete Reference, Seventh Edition

(Greg DeLong) #1

542 Part II: The Java Library


Method Description
boolean hasNext( ) Returnstrueif another token of any type is available to
be read. Returnsfalseother wise.
boolean hasNext(Patternpattern) Returnstrueif a token that matches the pattern passed
inpatternis available to be read. Returnsfalseother wise.
boolean hasNext(Stringpattern) Returnstrueif a token that matches the pattern passed
inpatternis available to be read. Returnsfalseother wise.
boolean hasNextBigDecimal( ) Returnstrueif a value that can be stored in aBigDecimal
object is available to be read. Returnsfalseother wise.
boolean hasNextBigInteger( ) Returnstrueif a value that can be stored in aBigInteger
object is available to be read. Returnsfalseother wise. The
default radix is used. (Unless changed, the default radix is 10.)
boolean hasNextBigInteger(intradix) Returnstrueif a value in the specified radix that can be
stored in aBigIntegerobject is available to be read.
Returnsfalseother wise.
boolean hasNextBoolean( ) Returnstrueif abooleanvalue is available to be read.
Returnsfalseother wise.
boolean hasNextByte( ) Returnstrueif abytevalue is available to be read. Returns
falseother wise. The default radix is used. (Unless changed,
the default radix is 10.)
boolean hasNextByte(intradix) Returnstrueif abytevalue in the specified radix is available
to be read. Returnsfalseother wise.
boolean hasNextDouble( ) Returnstrueif adoublevalue is available to be read. Returns
falseother wise.
boolean hasNextFloat( ) Returnstrueif afloatvalue is available to be read. Returns
falseother wise.
boolean hasNextInt( ) Returnstrueif anintvalue is available to be read. Returns
falseother wise. The default radix is used. (Unless changed,
the default radix is 10.)
boolean hasNextInt(intradix) Returnstrueif anintvalue in the specified radix is available
to be read. Returnsfalseother wise.
boolean hasNextLine( ) Returnstrueif a line of input is available.
boolean hasNextLong( ) Returnstrueif alongvalue is available to be read. Returns
falseother wise. The default radix is used. (Unless changed,
the default radix is 10.)
boolean hasNextLong(intradix) Returnstrueif alongvalue in the specified radix is available
to be read. Returnsfalseother wise.
boolean hasNextShort( ) Returnstrueif ashortvalue is available to be read.
Returnsfalseother wise. The default radix is used. (Unless
changed, the default radix is 10.)
boolean hasNextShort(intradix) Returnstrueif ashortvalue in the specified radix is available
to be read. Returnsfalseother wise.

TABLE 18-15 TheScanner hasNextMethods
Free download pdf