Package llnl.gnem.core.waveform.io
Class FloatBinaryData
java.lang.Object
llnl.gnem.core.waveform.io.BinaryData
llnl.gnem.core.waveform.io.FloatBinaryData
- Author:
- addair1
-
Constructor Summary
ConstructorDescriptionFloatBinaryData
(int n) Constructs a BinaryData object using an array of floats.FloatBinaryData
(FloatBinaryData 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
-
FloatBinaryData
public FloatBinaryData(int n) Constructs a BinaryData object using an array of floats. -
FloatBinaryData
-
-
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
-