Class FloatBufferData

All Implemented Interfaces:
Savable

public class FloatBufferData extends AbstractBufferData<FloatBuffer> implements Savable
Simple data class storing a buffer of floats and a number that indicates how many floats to group together to make up a "tuple"
  • Constructor Details

    • FloatBufferData

      public FloatBufferData()
      Instantiates a new FloatBufferData.
    • FloatBufferData

      public FloatBufferData(int size, int valuesPerTuple)
      Instantiates a new FloatBufferData with a buffer of the given size.
      Parameters:
      size - the size
      valuesPerTuple - Specifies the number of values per tuple. Can not be < 1.
    • FloatBufferData

      public FloatBufferData(FloatBuffer buffer, int valuesPerTuple)
      Creates a new FloatBufferData.
      Parameters:
      buffer - Buffer holding the data. Must not be null.
      valuesPerTuple - Specifies the number of values per tuple. Can not be < 1.
  • Method Details

    • getByteCount

      public int getByteCount()
      Specified by:
      getByteCount in class AbstractBufferData<FloatBuffer>
      Returns:
      the number of bytes per entry in the buffer. For example, an IntBuffer would return 4.
    • getTupleCount

      public int getTupleCount()
    • getValuesPerTuple

      public int getValuesPerTuple()
      Returns:
      number of values per tuple
    • scaleData

      public void scaleData(float... scales)
      Scale the data in this buffer by the given value(s)
      Parameters:
      scales - the scale values to use. The Nth buffer element is scaled by the (N % scales.length) scales element.
    • translateData

      public void translateData(float... translates)
      Translate the data in this buffer by the given value(s)
      Parameters:
      translates - the translation values to use. The Nth buffer element is translated by the (N % translates.length) translates element.
    • makeCopy

      public FloatBufferData makeCopy()
      Specified by:
      makeCopy in class AbstractBufferData<FloatBuffer>
      Returns:
      a deep copy of this buffer data object
    • getClassTag

      public Class<? extends FloatBufferData> getClassTag()
      Specified by:
      getClassTag in interface Savable
    • read

      public void read(InputCapsule capsule) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class AbstractBufferData<FloatBuffer>
      Throws:
      IOException
    • write

      public void write(OutputCapsule capsule) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class AbstractBufferData<FloatBuffer>
      Throws:
      IOException