asd_library.tree.bstree
Class ConsoleReader

java.lang.Object
  |
  +--asd_library.tree.bstree.ConsoleReader

class ConsoleReader
extends java.lang.Object

This class reads strings and numbers from a generic input stream. Creates a buffered input reader, catches I/O exceptions and converts strings into numbers.


Constructor Summary
ConsoleReader(java.io.InputStream inStream)
          Creates a console reader on an input stream, as System.in
 
Method Summary
 double readDouble()
          Legge una riga di input e la converte in un numero in virgola Mobile.
 int readInt()
          Reads an input line and converts it in a e la converte in un integer.
 java.lang.String readLine()
          Legge una riga di input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleReader

public ConsoleReader(java.io.InputStream inStream)
Creates a console reader on an input stream, as System.in

Parameters:
inStream - un flusso di input
Method Detail

readInt

public int readInt()
Reads an input line and converts it in a e la converte in un integer. La riga di input non puņ contenere altro che un integer. Non sono neppure ammessi spazi vuoti.

Returns:
l'integer digitato dall'utente

readDouble

public double readDouble()
Legge una riga di input e la converte in un numero in virgola Mobile. La riga di input non puņ contenere altro che un numero. Non sono neppure ammessi spazi vuoti.

Returns:
il numero digitato dall'utente

readLine

public java.lang.String readLine()
Legge una riga di input. Nel caso (improbabile) di una eccezione I/O, il programma si arresta.

Returns:
la riga di input digitata dall'utente, null alla fine dell'input