SSJ
V. 2.6.

umontreal.iro.lecuyer.util.io
Interface DataReader

All Known Implementing Classes:
AbstractDataReader, BinaryDataReader

public interface DataReader

Data reader interface.


Method Summary
 void close()
          Closes the input stream.
 boolean dataPending()
          Returns true if there remains data to be read.
 Map<String,DataField> readAllFields()
          Reads all fields in the file and returns a hashmap indexed by field labels.
 Map<String,DataField> readAllNextFields()
          Reads all remaining fields in the file and returns a hashmap indexed by field labels.
 double readDouble(String label)
          Reads the first field labeled as label and returns its double value.
 double[] readDoubleArray(String label)
          Reads the first field labeled as label and returns its value as a one-dimensional array of double's.
 double[][] readDoubleArray2D(String label)
          Reads the first field labeled as label and returns its value as a two-dimensional array of double's.
 DataField readField(String label)
          Reads the first field labeled as label.
 float readFloat(String label)
          Reads the first field labeled as label and returns its float value.
 float[] readFloatArray(String label)
          Reads the first field labeled as label and returns its value as a one-dimensional array of float's.
 float[][] readFloatArray2D(String label)
          Reads the first field labeled as label and returns its value as a two-dimensional array of float's.
 int readInt(String label)
          Reads the first field labeled as label and returns its int value.
 int[] readIntArray(String label)
          Reads the first field labeled as label and returns its value as a one-dimensional array of int's.
 int[][] readIntArray2D(String label)
          Reads the first field labeled as label and returns its value as a two-dimensional array of int's.
 DataField readNextField()
          Reads the next available field.
 String readString(String label)
          Reads the first field labeled as label and returns its String value.
 String[] readStringArray(String label)
          Reads the first field labeled as label and returns its value as a one-dimensional array of String's.
 String[][] readStringArray2D(String label)
          Reads the first field labeled as label and returns its value as a two-dimensional array of String's.
 void reset()
          Resets the reader to its initial state, i.e.
 

Method Detail

readString

String readString(String label)
                  throws IOException
Reads the first field labeled as label and returns its String value.

Throws:
IOException

readInt

int readInt(String label)
            throws IOException
Reads the first field labeled as label and returns its int value.

Throws:
IOException

readFloat

float readFloat(String label)
                throws IOException
Reads the first field labeled as label and returns its float value.

Throws:
IOException

readDouble

double readDouble(String label)
                  throws IOException
Reads the first field labeled as label and returns its double value.

Throws:
IOException

readStringArray

String[] readStringArray(String label)
                         throws IOException
Reads the first field labeled as label and returns its value as a one-dimensional array of String's.

Throws:
IOException

readIntArray

int[] readIntArray(String label)
                   throws IOException
Reads the first field labeled as label and returns its value as a one-dimensional array of int's.

Throws:
IOException

readFloatArray

float[] readFloatArray(String label)
                       throws IOException
Reads the first field labeled as label and returns its value as a one-dimensional array of float's.

Throws:
IOException

readDoubleArray

double[] readDoubleArray(String label)
                         throws IOException
Reads the first field labeled as label and returns its value as a one-dimensional array of double's.

Throws:
IOException

readStringArray2D

String[][] readStringArray2D(String label)
                             throws IOException
Reads the first field labeled as label and returns its value as a two-dimensional array of String's.

Throws:
IOException

readIntArray2D

int[][] readIntArray2D(String label)
                       throws IOException
Reads the first field labeled as label and returns its value as a two-dimensional array of int's.

Throws:
IOException

readFloatArray2D

float[][] readFloatArray2D(String label)
                           throws IOException
Reads the first field labeled as label and returns its value as a two-dimensional array of float's.

Throws:
IOException

readDoubleArray2D

double[][] readDoubleArray2D(String label)
                             throws IOException
Reads the first field labeled as label and returns its value as a two-dimensional array of double's.

Throws:
IOException

readAllNextFields

Map<String,DataField> readAllNextFields()
                                        throws IOException
Reads all remaining fields in the file and returns a hashmap indexed by field labels. Anonymous fields are mapped to "_data01_", "_data02_", ...

Throws:
IOException

readAllFields

Map<String,DataField> readAllFields()
                                    throws IOException
Reads all fields in the file and returns a hashmap indexed by field labels. Anonymous fields are mapped to "_data01_", "_data02_", ...

Throws:
IOException

readNextField

DataField readNextField()
                        throws IOException
Reads the next available field.

Returns:
a newly created DataField instance or null if not found
Throws:
IOException

readField

DataField readField(String label)
                    throws IOException
Reads the first field labeled as label.

Returns:
a newly created DataField instance or null if not found
Throws:
IOException

close

void close()
           throws IOException
Closes the input stream.

Throws:
IOException

reset

void reset()
           throws IOException
Resets the reader to its initial state, i.e. goes back to the beginning of the data stream, if possible.

Throws:
IOException

dataPending

boolean dataPending()
                    throws IOException
Returns true if there remains data to be read.

Throws:
IOException

SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.