uvascript
Class TextReader

java.lang.Object
  extended byjava.io.Reader
      extended byjava.io.BufferedReader
          extended byjava.io.LineNumberReader
              extended byuvascript.TextReader

public class TextReader
extends java.io.LineNumberReader

Text file reader.


Constructor Summary
TextReader(java.io.File f)
          Constructs a TextReader object.
 
Method Summary
 void close()
          Closes the stream.
 double[] readDoubles()
          Reads the next line consisting of several floating-point numbers separated by white spaces.
 int[] readIntegers()
          Reads the next line consisting of several integer numbers separated by white spaces.
 java.lang.String readLine()
          Returns the next line.
 
Methods inherited from class java.io.LineNumberReader
getLineNumber, mark, read, read, reset, setLineNumber, skip
 
Methods inherited from class java.io.BufferedReader
markSupported, ready
 
Methods inherited from class java.io.Reader
read
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextReader

public TextReader(java.io.File f)
           throws java.io.FileNotFoundException
Constructs a TextReader object.

Method Detail

close

public void close()
Closes the stream.


readLine

public java.lang.String readLine()
Returns the next line.

Returns:
null if the end of the file has been reached.
Throws:
a - runtime exception including an IOException.

readIntegers

public int[] readIntegers()
Reads the next line consisting of several integer numbers separated by white spaces.

Returns:
an array of int values in the line. If some fields are not numbers, they are interpreted as 0. The return value is null if the end of the file has been reached.

readDoubles

public double[] readDoubles()
Reads the next line consisting of several floating-point numbers separated by white spaces.

Returns:
an array of double values in the line. If some fields are not numbers, they are interpreted as 0.0. The return value is null if the end of the file has been reached.


UvaScript. Copyright (C) 2004 Shigeru Chiba. All Rights Reserved.