Package llnl.gnem.core.waveform.io
Class IntBinaryData
java.lang.Object
llnl.gnem.core.waveform.io.BinaryData
llnl.gnem.core.waveform.io.IntBinaryData
- Author:
- addair1
-
Constructor Summary
ConstructorDescriptionIntBinaryData
(int n) Constructs a BinaryData object using an array of ints.IntBinaryData
(IntBinaryData source, int newLength) -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
Returns an array of doubles corresponding to the contents of this object.float[]
Returns an array of floats corresponding to the contents of this object.int
getInt
(int i) int[]
Returns an array of ints corresponding to the contents of this object.void
setDouble
(int i, double value) void
setFloat
(int i, float value) void
setInt
(int i, int value) int
size()
Methods inherited from class llnl.gnem.core.waveform.io.BinaryData
fillAsFloats, fillAsInts, truncateTo
-
Constructor Details
-
IntBinaryData
public IntBinaryData(int n) Constructs a BinaryData object using an array of ints. -
IntBinaryData
-
-
Method Details
-
getIntData
public int[] getIntData()Description copied from class:BinaryData
Returns an array of ints corresponding to the contents of this object. If the internal data are in float or double form a loss of precision may occur.- Specified by:
getIntData
in classBinaryData
- Returns:
- The contents of this object as an array of ints.
-
getFloatData
public float[] getFloatData()Description copied from class:BinaryData
Returns an array of floats corresponding to the contents of this object. If the internal data are in double form a loss of precision may occur. If the internal data are stored as ints with values that require more precision that can be represented by a float then a loss of precision will occur.- Specified by:
getFloatData
in classBinaryData
- Returns:
- The contents of this object as an array of floats.
-
getDoubleData
public double[] getDoubleData()Description copied from class:BinaryData
Returns an array of doubles corresponding to the contents of this object. If the internal data are stored as ints with values that require more precision that can be represented by a double then a loss of precision will occur.- Specified by:
getDoubleData
in classBinaryData
- Returns:
- The contents of this object as an array of doubles.
-
getInt
public int getInt(int i) - Specified by:
getInt
in classBinaryData
-
size
public int size()- Specified by:
size
in classBinaryData
-
setInt
public void setInt(int i, int value) - Specified by:
setInt
in classBinaryData
-
setFloat
public void setFloat(int i, float value) - Specified by:
setFloat
in classBinaryData
-
setDouble
public void setDouble(int i, double value) - Specified by:
setDouble
in classBinaryData
-