StdIn

scala.io.StdIn$
object StdIn

Attributes

Source
StdIn.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
StdIn.type

Members list

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.

Attributes

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 (hidden)
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.

Attributes

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 (hidden)
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.

Attributes

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 (hidden)
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.

Attributes

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 (hidden)
Source
StdIn.scala
def readFloat(): Float

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

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

Attributes

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 (hidden)
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.

Attributes

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 (hidden)
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.

Attributes

Returns

the string read from the default input

Inherited from:
StdIn (hidden)
Source
StdIn.scala
def readLine(): String

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.

Attributes

Returns

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

Inherited from:
StdIn (hidden)
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.

Attributes

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 (hidden)
Source
StdIn.scala
def readShort(): Short

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

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

Attributes

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 (hidden)
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.

Attributes

Returns

a list of all extracted values.

Throws

java.io.EOFException if the end of the input stream has been reached.

Inherited from:
StdIn (hidden)
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.

Attributes

Returns

The first value that was extracted from the input

Inherited from:
StdIn (hidden)
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.

Attributes

Returns

A scala.Tuple2 containing the first two values extracted

Inherited from:
StdIn (hidden)
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.

Attributes

Returns

A scala.Tuple3 containing the first three values extracted

Inherited from:
StdIn (hidden)
Source
StdIn.scala