SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.util.io.DataReader Interface Reference

Data reader interface. More...

Inheritance diagram for umontreal.ssj.util.io.DataReader:
umontreal.ssj.util.io.AbstractDataReader umontreal.ssj.util.io.BinaryDataReader

Public Member Functions

Reading atomic data @{
String readString (String label) throws IOException
 Reads the first field labeled as label and returns its String value.
int readInt (String label) throws IOException
 Reads the first field labeled as label and returns its int value.
float readFloat (String label) throws IOException
 Reads the first field labeled as label and returns its float value.
double readDouble (String label) throws IOException
 Reads the first field labeled as label and returns its double value.
Reading one-dimensional arrays @{
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.
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.
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.
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.
Reading two-dimensional arrays @{
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.
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.
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.
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.
Reading fields of unknown type @{
Map< String, DataFieldreadAllNextFields () throws IOException
 Reads all remaining fields in the file and returns a hashmap indexed by field labels.
Map< String, DataFieldreadAllFields () throws IOException
 Reads all fields in the file and returns a hashmap indexed by field labels.
DataField readNextField () throws IOException
 Reads the next available field.
DataField readField (String label) throws IOException
 Reads the first field labeled as label.
Other methods @{
void close () throws IOException
 Closes the input stream.
void reset () throws IOException
 Resets the reader to its initial state, i.e.
boolean dataPending () throws IOException
 Returns true if there remains data to be read.

Detailed Description

Data reader interface.

Definition at line 35 of file DataReader.java.

Member Function Documentation

◆ close()

void umontreal.ssj.util.io.DataReader.close ( ) throws IOException

Closes the input stream.

Implemented in umontreal.ssj.util.io.BinaryDataReader.

◆ dataPending()

boolean umontreal.ssj.util.io.DataReader.dataPending ( ) throws IOException

Returns true if there remains data to be read.

Implemented in umontreal.ssj.util.io.BinaryDataReader.

◆ readAllFields()

Map< String, DataField > umontreal.ssj.util.io.DataReader.readAllFields ( ) throws IOException

Reads all fields in the file and returns a hashmap indexed by field labels.

Anonymous fields are mapped to "_data01_", "_data02_", …

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readAllNextFields()

Map< String, DataField > umontreal.ssj.util.io.DataReader.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_", …

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readDouble()

double umontreal.ssj.util.io.DataReader.readDouble ( String label) throws IOException

Reads the first field labeled as label and returns its double value.

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readDoubleArray()

double[] umontreal.ssj.util.io.DataReader.readDoubleArray ( String label) throws IOException

Reads the first field labeled as label and returns its value as a one-dimensional array of double’s.

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readDoubleArray2D()

double[][] umontreal.ssj.util.io.DataReader.readDoubleArray2D ( String label) throws IOException

Reads the first field labeled as label and returns its value as a two-dimensional array of double’s.

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readField()

DataField umontreal.ssj.util.io.DataReader.readField ( String label) throws IOException

Reads the first field labeled as label.

Returns
a newly created DataField instance or null if not found

Implemented in umontreal.ssj.util.io.BinaryDataReader.

◆ readFloat()

float umontreal.ssj.util.io.DataReader.readFloat ( String label) throws IOException

Reads the first field labeled as label and returns its float value.

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readFloatArray()

float[] umontreal.ssj.util.io.DataReader.readFloatArray ( String label) throws IOException

Reads the first field labeled as label and returns its value as a one-dimensional array of float’s.

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readFloatArray2D()

float[][] umontreal.ssj.util.io.DataReader.readFloatArray2D ( String label) throws IOException

Reads the first field labeled as label and returns its value as a two-dimensional array of float’s.

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readInt()

int umontreal.ssj.util.io.DataReader.readInt ( String label) throws IOException

Reads the first field labeled as label and returns its int value.

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readIntArray()

int[] umontreal.ssj.util.io.DataReader.readIntArray ( String label) throws IOException

Reads the first field labeled as label and returns its value as a one-dimensional array of int’s.

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readIntArray2D()

int[][] umontreal.ssj.util.io.DataReader.readIntArray2D ( String label) throws IOException

Reads the first field labeled as label and returns its value as a two-dimensional array of int’s.

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readNextField()

DataField umontreal.ssj.util.io.DataReader.readNextField ( ) throws IOException

Reads the next available field.

Returns
a newly created DataField instance or null if not found

Implemented in umontreal.ssj.util.io.BinaryDataReader.

◆ readString()

String umontreal.ssj.util.io.DataReader.readString ( String label) throws IOException

Reads the first field labeled as label and returns its String value.

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readStringArray()

String[] umontreal.ssj.util.io.DataReader.readStringArray ( String label) throws IOException

Reads the first field labeled as label and returns its value as a one-dimensional array of String’s.

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ readStringArray2D()

String[][] umontreal.ssj.util.io.DataReader.readStringArray2D ( String label) throws IOException

Reads the first field labeled as label and returns its value as a two-dimensional array of String’s.

Implemented in umontreal.ssj.util.io.AbstractDataReader.

◆ reset()

void umontreal.ssj.util.io.DataReader.reset ( ) throws IOException

Resets the reader to its initial state, i.e.

goes back to the beginning of the data stream, if possible.

Implemented in umontreal.ssj.util.io.BinaryDataReader.


The documentation for this interface was generated from the following file: