This abstract class implements shared functionality for data readers. More...
Public Member Functions | |
Reading atomic data @{ | |
| String | readString (String label) throws IOException |
| Reads first field labeled as label and returns its String value. | |
| int | readInt (String label) throws IOException |
| Reads first field labeled as label and returns its int value. | |
| float | readFloat (String label) throws IOException |
| Reads first field labeled as label and returns its float value. | |
| double | readDouble (String label) throws IOException |
| Reads first field labeled as label and returns its double value. | |
Reading one-dimensional arrays @{ | |
| String[] | readStringArray (String label) throws IOException |
| Reads first field labeled as label and returns its value as a one-dimensional array of String’s. | |
| int[] | readIntArray (String label) throws IOException |
| Reads first field labeled as label and returns its value as a one-dimensional array of int’s. | |
| float[] | readFloatArray (String label) throws IOException |
| Reads first field labeled as label and returns its value as a one-dimensional array of float’s. | |
| double[] | readDoubleArray (String label) throws IOException |
| Reads 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 first field labeled as label and returns its value as a two-dimensional array of String’s. | |
| int[][] | readIntArray2D (String label) throws IOException |
| Reads first field labeled as label and returns its value as a two-dimensional array of int’s. | |
| float[][] | readFloatArray2D (String label) throws IOException |
| Reads first field labeled as label and returns its value as a two-dimensional array of float’s. | |
| double[][] | readDoubleArray2D (String label) throws IOException |
| Reads first field labeled as label and returns its value as a two-dimensional array of double’s. | |
Reading fields of unknown type @{ | |
| Map< String, DataField > | readAllNextFields () throws IOException |
| Reads all remaining fields in the file and returns a hashmap indexed by field labels. | |
| Map< String, DataField > | readAllFields () throws IOException |
| Reads all fields in the file and returns a hashmap indexed by field labels. | |
| Public Member Functions inherited from umontreal.ssj.util.io.DataReader | |
| DataField | readNextField () throws IOException |
| Reads the next available field. | |
| DataField | readField (String label) throws IOException |
| Reads the first field labeled as label. | |
| 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. | |
This abstract class implements shared functionality for data readers.
Definition at line 36 of file AbstractDataReader.java.
| Map< String, DataField > umontreal.ssj.util.io.AbstractDataReader.readAllFields | ( | ) | throws IOException |
Reads all fields in the file and returns a hashmap indexed by field labels.
Anonymous fields are mapped to "_data01_", "_data02_", …
Implements umontreal.ssj.util.io.DataReader.
Definition at line 188 of file AbstractDataReader.java.
| Map< String, DataField > umontreal.ssj.util.io.AbstractDataReader.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_", …
Implements umontreal.ssj.util.io.DataReader.
Definition at line 163 of file AbstractDataReader.java.
| double umontreal.ssj.util.io.AbstractDataReader.readDouble | ( | String | label | ) | throws IOException |
Reads first field labeled as label and returns its double value.
Implements umontreal.ssj.util.io.DataReader.
Definition at line 66 of file AbstractDataReader.java.
| double[] umontreal.ssj.util.io.AbstractDataReader.readDoubleArray | ( | String | label | ) | throws IOException |
Reads first field labeled as label and returns its value as a one-dimensional array of double’s.
Implements umontreal.ssj.util.io.DataReader.
Definition at line 106 of file AbstractDataReader.java.
| double[][] umontreal.ssj.util.io.AbstractDataReader.readDoubleArray2D | ( | String | label | ) | throws IOException |
Reads first field labeled as label and returns its value as a two-dimensional array of double’s.
Implements umontreal.ssj.util.io.DataReader.
Definition at line 146 of file AbstractDataReader.java.
| float umontreal.ssj.util.io.AbstractDataReader.readFloat | ( | String | label | ) | throws IOException |
Reads first field labeled as label and returns its float value.
Implements umontreal.ssj.util.io.DataReader.
Definition at line 59 of file AbstractDataReader.java.
| float[] umontreal.ssj.util.io.AbstractDataReader.readFloatArray | ( | String | label | ) | throws IOException |
Reads first field labeled as label and returns its value as a one-dimensional array of float’s.
Implements umontreal.ssj.util.io.DataReader.
Definition at line 98 of file AbstractDataReader.java.
| float[][] umontreal.ssj.util.io.AbstractDataReader.readFloatArray2D | ( | String | label | ) | throws IOException |
Reads first field labeled as label and returns its value as a two-dimensional array of float’s.
Implements umontreal.ssj.util.io.DataReader.
Definition at line 138 of file AbstractDataReader.java.
| int umontreal.ssj.util.io.AbstractDataReader.readInt | ( | String | label | ) | throws IOException |
Reads first field labeled as label and returns its int value.
Implements umontreal.ssj.util.io.DataReader.
Definition at line 52 of file AbstractDataReader.java.
| int[] umontreal.ssj.util.io.AbstractDataReader.readIntArray | ( | String | label | ) | throws IOException |
Reads first field labeled as label and returns its value as a one-dimensional array of int’s.
Implements umontreal.ssj.util.io.DataReader.
Definition at line 90 of file AbstractDataReader.java.
| int[][] umontreal.ssj.util.io.AbstractDataReader.readIntArray2D | ( | String | label | ) | throws IOException |
Reads first field labeled as label and returns its value as a two-dimensional array of int’s.
Implements umontreal.ssj.util.io.DataReader.
Definition at line 130 of file AbstractDataReader.java.
| String umontreal.ssj.util.io.AbstractDataReader.readString | ( | String | label | ) | throws IOException |
Reads first field labeled as label and returns its String value.
Implements umontreal.ssj.util.io.DataReader.
Definition at line 45 of file AbstractDataReader.java.
| String[] umontreal.ssj.util.io.AbstractDataReader.readStringArray | ( | String | label | ) | throws IOException |
Reads first field labeled as label and returns its value as a one-dimensional array of String’s.
Implements umontreal.ssj.util.io.DataReader.
Definition at line 82 of file AbstractDataReader.java.
| String[][] umontreal.ssj.util.io.AbstractDataReader.readStringArray2D | ( | String | label | ) | throws IOException |
Reads first field labeled as label and returns its value as a two-dimensional array of String’s.
Implements umontreal.ssj.util.io.DataReader.
Definition at line 122 of file AbstractDataReader.java.