|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.util.io.DataField
public class DataField
This class represents a data field from a file read by an instance of a class
implementing DataReader
.
Constructor Summary | |
---|---|
DataField(String label,
Object data)
Constructor. |
|
DataField(String label,
Object data,
int effectiveLength)
Constructor. |
Method Summary | |
---|---|
double |
asDouble()
Returns the value as double or 0 if it is not of type double See isDouble . |
double[] |
asDoubleArray()
Returns the value as one-dimensional double array or null if it is not of type double[]. |
double[][] |
asDoubleArray2D()
Returns the value as two-dimensional double array or null if it is not of type double[][]. |
float |
asFloat()
Returns the value as float or 0 if it is not of type float See isFloat . |
float[] |
asFloatArray()
Returns the value as one-dimensional float array or null if it is not of type float[]. |
float[][] |
asFloatArray2D()
Returns the value as two-dimensional float array or null if it is not of type float[][]. |
int |
asInt()
Returns the value as int or 0 if it is not of type int See isInt . |
int[] |
asIntArray()
Returns the value as one-dimensional int array or null if it is not of type int[]. |
int[][] |
asIntArray2D()
Returns the value as two-dimensional int array or null if it is not of type int[][]. |
Object |
asObject()
Returns the value of the field as an Object. |
String |
asString()
Returns the value as String, or null if it is not of type String. |
String[] |
asStringArray()
Returns the value as one-dimensional String array or null if it is not of type String[]. |
String[][] |
asStringArray2D()
Returns the value as two-dimensional String array or null if it is not of type String[][]. |
int |
getArrayLength()
Returns the length of the array contained by the field, or -1 if it is not an array. |
String |
getLabel()
Returns the field label (or name). |
Class |
getType()
Returns the type of the field. |
boolean |
isArray()
Returns true if the field contains an array. |
boolean |
isArray2D()
Returns true if the field contains a two-dimensional array. |
boolean |
isAtomic()
Returns true if the field value is atomic data. |
boolean |
isDouble()
Returns true if the field value is an atomic double. |
boolean |
isFloat()
Returns true if the field value is an atomic float. |
boolean |
isInt()
Returns true if the field value is an atomic int. |
boolean |
isString()
Returns true if the field value is an atomic String. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataField(String label, Object data)
label
- name of the fielddata
- value of the fieldpublic DataField(String label, Object data, int effectiveLength)
label
- name of the fielddata
- value of the fieldeffectiveLength
- number of significant elements contained in dataMethod Detail |
---|
public String getLabel()
public Class getType()
public boolean isAtomic()
public boolean isArray()
public boolean isArray2D()
public int getArrayLength()
public boolean isString()
public boolean isInt()
public boolean isFloat()
public boolean isDouble()
public String asString()
isString
.
public int asInt()
isInt
.
public float asFloat()
isFloat
.
public double asDouble()
isDouble
.
public String[] asStringArray()
public int[] asIntArray()
public float[] asFloatArray()
public double[] asDoubleArray()
public String[][] asStringArray2D()
public int[][] asIntArray2D()
public float[][] asFloatArray2D()
public double[][] asDoubleArray2D()
public Object asObject()
|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |