This class represents a data field from a file read by an instance of a class implementing DataReader. More...
Public Member Functions | |
| DataField (String label, Object data) | |
| Constructor. | |
| DataField (String label, Object data, int effectiveLength) | |
| Constructor. | |
Information on the field @{ | |
| String | getLabel () |
| Returns the field label (or name). | |
| Class | getType () |
| Returns the type of the field. | |
| boolean | isAtomic () |
| Returns true if the field value is atomic data. | |
| boolean | isArray () |
| Returns true if the field contains an array. | |
| boolean | isArray2D () |
| Returns true if the field contains a two-dimensional array. | |
| int | getArrayLength () |
| Returns the length of the array contained by the field, or -1 if it is not an array. | |
| boolean | isString () |
| Returns true if the field value is an atomic String. | |
| boolean | isInt () |
| Returns true if the field value is an atomic int. | |
| boolean | isFloat () |
| Returns true if the field value is an atomic float. | |
| boolean | isDouble () |
| Returns true if the field value is an atomic double. | |
Obtaining the value as atomic data @{ | |
| String | asString () |
| Returns the value as String, or null if it is not of type String. | |
| int | asInt () |
| Returns the value as int or 0 if it is not of type int See isInt. | |
| float | asFloat () |
| Returns the value as float or 0 if it is not of type float See isFloat. | |
| double | asDouble () |
| Returns the value as double or 0 if it is not of type double See isDouble. | |
Obtaining the value as a one-dimensional array @{ | |
| String[] | asStringArray () |
| Returns the value as one-dimensional String array or null if it is not of type String[]. | |
| int[] | asIntArray () |
| Returns the value as one-dimensional int array or null if it is not of type int[]. | |
| float[] | asFloatArray () |
| Returns the value as one-dimensional float array or null if it is not of type float[]. | |
| double[] | asDoubleArray () |
| Returns the value as one-dimensional double array or null if it is not of type double[]. | |
Obtaining the value as a two-dimensional array @{ | |
| String[][] | asStringArray2D () |
| Returns the value as two-dimensional String array or null if it is not of type String[][]. | |
| int[][] | asIntArray2D () |
| Returns the value as two-dimensional int array or null if it is not of type int[][]. | |
| float[][] | asFloatArray2D () |
| Returns the value as two-dimensional float array or null if it is not of type float[][]. | |
| double[][] | asDoubleArray2D () |
| Returns the value as two-dimensional double array or null if it is not of type double[][]. | |
Obtaining the value as an <tt>Object</tt> @{ | |
| Object | asObject () |
| Returns the value of the field as an Object. | |
This class represents a data field from a file read by an instance of a class implementing DataReader.
Definition at line 35 of file DataField.java.
| umontreal.ssj.util.io.DataField.DataField | ( | String | label, |
| Object | data ) |
Constructor.
Creates a field named label of value data.
| label | name of the field |
| data | value of the field |
Definition at line 46 of file DataField.java.
| umontreal.ssj.util.io.DataField.DataField | ( | String | label, |
| Object | data, | ||
| int | effectiveLength ) |
Constructor.
Creates a field named label of value data. effectiveLength is the number of significant elements contained in data if it is an array.
| label | name of the field |
| data | value of the field |
| effectiveLength | number of significant elements contained in data |
Definition at line 58 of file DataField.java.
| double umontreal.ssj.util.io.DataField.asDouble | ( | ) |
Returns the value as double or 0 if it is not of type double See isDouble.
Definition at line 178 of file DataField.java.
| double[] umontreal.ssj.util.io.DataField.asDoubleArray | ( | ) |
Returns the value as one-dimensional double array or null if it is not of type double[].
Definition at line 218 of file DataField.java.
| double[][] umontreal.ssj.util.io.DataField.asDoubleArray2D | ( | ) |
Returns the value as two-dimensional double array or null if it is not of type double[][].
Definition at line 258 of file DataField.java.
| float umontreal.ssj.util.io.DataField.asFloat | ( | ) |
Returns the value as float or 0 if it is not of type float See isFloat.
Definition at line 170 of file DataField.java.
| float[] umontreal.ssj.util.io.DataField.asFloatArray | ( | ) |
Returns the value as one-dimensional float array or null if it is not of type float[].
Definition at line 210 of file DataField.java.
| float[][] umontreal.ssj.util.io.DataField.asFloatArray2D | ( | ) |
Returns the value as two-dimensional float array or null if it is not of type float[][].
Definition at line 250 of file DataField.java.
| int umontreal.ssj.util.io.DataField.asInt | ( | ) |
Returns the value as int or 0 if it is not of type int See isInt.
Definition at line 162 of file DataField.java.
| int[] umontreal.ssj.util.io.DataField.asIntArray | ( | ) |
Returns the value as one-dimensional int array or null if it is not of type int[].
Definition at line 202 of file DataField.java.
| int[][] umontreal.ssj.util.io.DataField.asIntArray2D | ( | ) |
Returns the value as two-dimensional int array or null if it is not of type int[][].
Definition at line 242 of file DataField.java.
| Object umontreal.ssj.util.io.DataField.asObject | ( | ) |
Returns the value of the field as an Object.
Definition at line 273 of file DataField.java.
| String umontreal.ssj.util.io.DataField.asString | ( | ) |
Returns the value as String, or null if it is not of type String.
See isString.
Definition at line 155 of file DataField.java.
| String[] umontreal.ssj.util.io.DataField.asStringArray | ( | ) |
Returns the value as one-dimensional String array or null if it is not of type String[].
Definition at line 194 of file DataField.java.
| String[][] umontreal.ssj.util.io.DataField.asStringArray2D | ( | ) |
Returns the value as two-dimensional String array or null if it is not of type String[][].
Definition at line 234 of file DataField.java.
| int umontreal.ssj.util.io.DataField.getArrayLength | ( | ) |
Returns the length of the array contained by the field, or -1 if it is not an array.
Definition at line 107 of file DataField.java.
| String umontreal.ssj.util.io.DataField.getLabel | ( | ) |
Returns the field label (or name).
Definition at line 71 of file DataField.java.
| Class umontreal.ssj.util.io.DataField.getType | ( | ) |
Returns the type of the field.
Definition at line 78 of file DataField.java.
| boolean umontreal.ssj.util.io.DataField.isArray | ( | ) |
Returns true if the field contains an array.
Definition at line 92 of file DataField.java.
| boolean umontreal.ssj.util.io.DataField.isArray2D | ( | ) |
Returns true if the field contains a two-dimensional array.
Definition at line 99 of file DataField.java.
| boolean umontreal.ssj.util.io.DataField.isAtomic | ( | ) |
Returns true if the field value is atomic data.
Definition at line 85 of file DataField.java.
| boolean umontreal.ssj.util.io.DataField.isDouble | ( | ) |
Returns true if the field value is an atomic double.
Definition at line 139 of file DataField.java.
| boolean umontreal.ssj.util.io.DataField.isFloat | ( | ) |
Returns true if the field value is an atomic float.
Definition at line 132 of file DataField.java.
| boolean umontreal.ssj.util.io.DataField.isInt | ( | ) |
Returns true if the field value is an atomic int.
Definition at line 125 of file DataField.java.
| boolean umontreal.ssj.util.io.DataField.isString | ( | ) |
Returns true if the field value is an atomic String.
Definition at line 118 of file DataField.java.