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
ConstructorsConstructorDescriptionFloatBinaryData(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.intgetInt(int i) int[]Returns an array of ints corresponding to the contents of this object.voidsetDouble(int i, double value) voidsetFloat(int i, float value) voidsetInt(int i, int value) intsize()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:BinaryDataReturns 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:
getIntDatain classBinaryData- Returns:
- The contents of this object as an array of ints.
-
getFloatData
public float[] getFloatData()Description copied from class:BinaryDataReturns 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:
getFloatDatain classBinaryData- Returns:
- The contents of this object as an array of floats.
-
getDoubleData
public double[] getDoubleData()Description copied from class:BinaryDataReturns 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:
getDoubleDatain classBinaryData- Returns:
- The contents of this object as an array of doubles.
-
getInt
public int getInt(int i) - Specified by:
getIntin classBinaryData
-
size
public int size()- Specified by:
sizein classBinaryData
-
setInt
public void setInt(int i, int value) - Specified by:
setIntin classBinaryData
-
setFloat
public void setFloat(int i, float value) - Specified by:
setFloatin classBinaryData
-
setDouble
public void setDouble(int i, double value) - Specified by:
setDoublein classBinaryData
-