Class StdInput

java.lang.Object
  extended byStdInput

public class StdInput
extends Object

The StdInput class provides methods to read basic type data from standard input.

Author:
V. Granet

Field Summary
private static int LineBufferLength
           
private static PushbackReader stdin
           
 
Constructor Summary
StdInput()
           
 
Method Summary
static char readChar()
          Reads next character from standard input.
static double readDouble()
          Reads from standard input characters which represent a double.
static float readFloat()
          Reads from standard input characters which represent a float.
static int readInt()
          Reads from standard input characters which represent a int.
static String readLine()
          Reads up to the end of line characters from standard input,
static void readln()
          Go to next line from standard input,
static char readlnChar()
          Reads next character from standard input, and go to the first character of next line
static double readlnDouble()
          Reads from standard input characters which represent a double, and go to the first character of the next line.
static float readlnFloat()
          Reads from standard input characters which represent a float, and go to the first character of the next line.
static int readlnInt()
          Reads from standard input characters which represent a int, and go to the first character of the next line.
static long readlnLong()
          Reads from standard input characters which represent a long, and go to the first character of the next line.
static short readlnShort()
          Reads from standard input characters which represent a short, and go to the first character of the next line.
static long readLong()
          Reads from standard input characters which represent a long.
private static long readLong(int radix)
           
private static double readNumber()
           
static short readShort()
          Reads from standard input characters which represent a short.
static String readString(int n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stdin

private static PushbackReader stdin

LineBufferLength

private static final int LineBufferLength
See Also:
Constant Field Values
Constructor Detail

StdInput

public StdInput()
Method Detail

readLong

private static long readLong(int radix)
                      throws IOException
Throws:
IOException

readNumber

private static double readNumber()
                          throws IOException
Throws:
IOException

readShort

public static short readShort()
                       throws IOException
Reads from standard input characters which represent a short. Leading spaces are skipped.

Throws:
IOException
Returns:
a short

readlnShort

public static short readlnShort()
                         throws IOException
Reads from standard input characters which represent a short, and go to the first character of the next line. Leading spaces are skipped.

Throws:
IOException
Returns:
a short

readInt

public static int readInt()
                   throws IOException
Reads from standard input characters which represent a int. Leading spaces are skipped.

Throws:
IOException
Returns:
a int

readlnInt

public static int readlnInt()
                     throws IOException
Reads from standard input characters which represent a int, and go to the first character of the next line. Leading spaces are skipped.

Throws:
IOException
Returns:
a int

readLong

public static long readLong()
                     throws IOException
Reads from standard input characters which represent a long. Leading spaces are skipped.

Throws:
IOException
Returns:
a long

readlnLong

public static long readlnLong()
                       throws IOException
Reads from standard input characters which represent a long, and go to the first character of the next line. Leading spaces are skipped.

Throws:
IOException
Returns:
a long

readDouble

public static double readDouble()
                         throws IOException
Reads from standard input characters which represent a double. Leading spaces are skipped.

Throws:
IOException
Returns:
a double

readlnDouble

public static double readlnDouble()
                           throws IOException
Reads from standard input characters which represent a double, and go to the first character of the next line. Leading spaces are skipped.

Throws:
IOException
Returns:
a double

readFloat

public static float readFloat()
                       throws IOException
Reads from standard input characters which represent a float. Leading spaces are skipped.

Throws:
IOException
Returns:
a float

readlnFloat

public static float readlnFloat()
                         throws IOException
Reads from standard input characters which represent a float, and go to the first character of the next line. Leading spaces are skipped.

Throws:
IOException
Returns:
a float

readChar

public static char readChar()
                     throws IOException
Reads next character from standard input.

Throws:
IOException
Returns:
a char

readlnChar

public static char readlnChar()
                       throws IOException
Reads next character from standard input, and go to the first character of next line

Throws:
IOException
Returns:
a char

readString

public static String readString(int n)
                         throws IOException
Throws:
IOException

readLine

public static String readLine()
                       throws IOException
Reads up to the end of line characters from standard input,

Throws:
IOException
Returns:
a String

readln

public static void readln()
                   throws IOException
Go to next line from standard input,

Throws:
IOException