scala

object Console

[source: scala/Console.scala]

object Console
extends AnyRef
The Console object implements functionality for printing Scala values on the terminal. There are also functions for reading specific values. Console also defines constants for marking up text on ANSI terminals.
Author
Matthias Zenger
Version
1.0, 03/09/2003
Value Summary
final val BLACK : String = "\033[30m"
final val BLACK_B : String = "\033[40m"
final val BLINK : String = "\033[5m"
final val BLUE : String = "\033[34m"
final val BLUE_B : String = "\033[44m"
final val BOLD : String = "\033[1m"
final val CYAN : String = "\033[36m"
final val CYAN_B : String = "\033[46m"
final val GREEN : String = "\033[32m"
final val GREEN_B : String = "\033[42m"
final val INVISIBLE : String = "\033[8m"
final val MAGENTA : String = "\033[35m"
final val MAGENTA_B : String = "\033[45m"
final val RED : String = "\033[31m"
final val RED_B : String = "\033[41m"
final val RESET : String = "\033[0m"
final val REVERSED : String = "\033[7m"
final val UNDERLINED : String = "\033[4m"
final val WHITE : String = "\033[37m"
final val WHITE_B : String = "\033[47m"
final val YELLOW : String = "\033[33m"
final val YELLOW_B : String = "\033[43m"
val err : PrintStream
Method Summary
def flush : Unit
Flush the output stream. This function is required when partial output (i.e. output not terminated by a new line character) has to be made visible on the terminal.
def format (text : String, args : Any*) : Unit
def in : BufferedReader
def out : PrintStream
def print (obj : Any) : Unit
Print an object on the terminal.
def printf (text : String, args : Any*) : Unit

Format and print out some text (in a fashion similar to printf in C or printf in Java 6).

The format of the text to print is specified by the parameter text. The arguments that are inserted into specific locations in text are provided with parameter args. See class java.text.MessageFormat for a full specification of the format syntax.

def println : Unit
Print a new line character on the terminal.
def println (x : Any) : Unit
Print out an object followed by a new line character.
def readBoolean : Boolean
Read a boolean value from the terminal.
def readByte : Byte
Read a byte value from the terminal.
def readChar : Char
Read a char value from the terminal.
def readDouble : Double
Read a double value from the terminal.
def readFloat : Float
Read a float value from the terminal.
def readInt : Int
Read an int value from the terminal.
def readLine (text : String, args : Any*) : String
Print a formatted text and read a full line from the terminal
def readLine : String
Read a full line from the terminal.
def readLong : Long
Read an int value from the terminal.
def readShort : Short
Read a short value from the terminal.
def readf (format : String) : List[Any]
Read in some structured input, specified by a format specifier. See class java.text.MessageFormat for details of the format specification.
def readf1 (format : String) : Any
Read in some structured input, specified by a format specifier. Opposed to readf, this function only returns the first value extracted from the input according to the format specification.
def readf2 (format : String) : (Any, Any)
Read in some structured input, specified by a format specifier. Opposed to readf, this function only returns the first two values extracted from the input according to the format specification.
def readf3 (format : String) : (Any, Any, Any)
Read in some structured input, specified by a format specifier. Opposed to readf, this function only returns the first three values extracted from the input according to the format specification.
def setIn (reader : Reader) : Unit
Set the default input stream.
def setIn (in : InputStream) : Unit
Set the default input stream.
def setOut (out : PrintStream) : Unit
Set the default output stream.
def setOut (out : OutputStream) : Unit
Set the default output stream. @param@ out the new output stream.
def withIn [T](in : InputStream)(thunk : => T) : T
Set the default input stream for the duration of execution of one thunk.
def withIn [T](reader : Reader)(thunk : => T) : T
Set the default input stream for the duration of execution of one thunk.
def withOut [T](out : OutputStream)(thunk : => T) : T
Set the default output stream for the duration of execution of one thunk.
def withOut [T](out : PrintStream)(thunk : => T) : T
Set the default output stream for the duration of execution of one thunk.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf