StdIn

object StdIn extends StdIn
trait StdIn
class Object
trait Matchable
class Any
StdIn.type

Value members

Inherited methods

Reads a boolean value from an entire line of the default input.

Reads a boolean value from an entire line of the default input. Has a fairly liberal interpretation of the input.

Returns:

the boolean value read, or false if it couldn't be converted to a boolean

Throws:
java.io.EOFException

if the end of the input stream has been reached.

Inherited from:
StdIn
Source:
StdIn.scala
def readByte(): Byte

Reads a byte value from an entire line of the default input.

Reads a byte value from an entire line of the default input.

Returns:

the Byte that was read

Throws:
java.io.EOFException

if the end of the input stream has been reached.

java.lang.NumberFormatException

if the value couldn't be converted to a Byte

Inherited from:
StdIn
Source:
StdIn.scala
def readChar(): Char

Reads a char value from an entire line of the default input.

Reads a char value from an entire line of the default input.

Returns:

the Char that was read

Throws:
java.io.EOFException

if the end of the input stream has been reached.

java.lang.StringIndexOutOfBoundsException

if the line read from default input was empty

Inherited from:
StdIn
Source:
StdIn.scala

Reads a double value from an entire line of the default input.

Reads a double value from an entire line of the default input.

Returns:

the Double that was read.

Throws:
java.io.EOFException

if the end of the input stream has been reached.

java.lang.NumberFormatException

if the value couldn't be converted to a Float

Inherited from:
StdIn
Source:
StdIn.scala

Reads a float value from an entire line of the default input.

Reads a float value from an entire line of the default input.

Returns:

the Float that was read.

Throws:
java.io.EOFException

if the end of the input stream has been reached.

java.lang.NumberFormatException

if the value couldn't be converted to a Float

Inherited from:
StdIn
Source:
StdIn.scala
def readInt(): Int

Reads an int value from an entire line of the default input.

Reads an int value from an entire line of the default input.

Returns:

the Int that was read

Throws:
java.io.EOFException

if the end of the input stream has been reached.

java.lang.NumberFormatException

if the value couldn't be converted to an Int

Inherited from:
StdIn
Source:
StdIn.scala
def readLine(text: String, args: Any*): String

Print and flush formatted text to the default output, and read a full line from the default input.

Print and flush formatted text to the default output, and read a full line from the default input. Returns null if the end of the input stream has been reached.

Value parameters:
args

the parameters used to instantiate the format, as in printf.

text

the format of the text to print out, as in printf.

Returns:

the string read from the default input

Inherited from:
StdIn
Source:
StdIn.scala

Read a full line from the default input.

Read a full line from the default input. Returns null if the end of the input stream has been reached.

Returns:

the string read from the terminal or null if the end of stream was reached.

Inherited from:
StdIn
Source:
StdIn.scala
def readLong(): Long

Reads an long value from an entire line of the default input.

Reads an long value from an entire line of the default input.

Returns:

the Long that was read

Throws:
java.io.EOFException

if the end of the input stream has been reached.

java.lang.NumberFormatException

if the value couldn't be converted to a Long

Inherited from:
StdIn
Source:
StdIn.scala

Reads a short value from an entire line of the default input.

Reads a short value from an entire line of the default input.

Returns:

the short that was read

Throws:
java.io.EOFException

if the end of the input stream has been reached.

java.lang.NumberFormatException

if the value couldn't be converted to a Short

Inherited from:
StdIn
Source:
StdIn.scala
def readf(format: String): List[Any]

Reads in some structured input (from the default input), specified by a format specifier.

Reads in some structured input (from the default input), specified by a format specifier. See class java.text.MessageFormat for details of the format specification.

Value parameters:
format

the format of the input.

Returns:

a list of all extracted values.

Throws:
java.io.EOFException

if the end of the input stream has been reached.

Inherited from:
StdIn
Source:
StdIn.scala
def readf1(format: String): Any

Reads in some structured input (from the default input), specified by a format specifier, returning only the first value extracted, according to the format specification.

Reads in some structured input (from the default input), specified by a format specifier, returning only the first value extracted, according to the format specification.

Value parameters:
format

format string, as accepted by readf.

Returns:

The first value that was extracted from the input

Inherited from:
StdIn
Source:
StdIn.scala
def readf2(format: String): (Any, Any)

Reads in some structured input (from the default input), specified by a format specifier, returning only the first two values extracted, according to the format specification.

Reads in some structured input (from the default input), specified by a format specifier, returning only the first two values extracted, according to the format specification.

Value parameters:
format

format string, as accepted by readf.

Returns:

A scala.Tuple2 containing the first two values extracted

Inherited from:
StdIn
Source:
StdIn.scala
def readf3(format: String): (Any, Any, Any)

Reads in some structured input (from the default input), specified by a format specifier, returning only the first three values extracted, according to the format specification.

Reads in some structured input (from the default input), specified by a format specifier, returning only the first three values extracted, according to the format specification.

Value parameters:
format

format string, as accepted by readf.

Returns:

A scala.Tuple3 containing the first three values extracted

Inherited from:
StdIn
Source:
StdIn.scala