Class ByteArrayFrame<T>


public class ByteArrayFrame<T> extends Frame<T>
Implements an object-holding Frame backed by a byte array. This avoids creation of new objects by only converting to objects when the value is requested.
  • Constructor Details

    • ByteArrayFrame

      public ByteArrayFrame(int capacity, double timestamp, T defaultData, ByteArrayFrame.ByteArrayToType<T> conversion)
      Instantiates a new DoubleFrame.
      capacity - The capacity of the byte array value held.
      timestamp - The timestamp the update happened at.
      defaultData - An instance of the object to return before the first update happens.
      conversion - A function that takes in a double and converts it to the final datatype.
  • Method Details

    • getValue

      public T getValue()
      Description copied from class: Frame
      Returns the value of the data frame.
      Specified by:
      getValue in class Frame<T>
      the value the data frame holds.
    • hasData

      public boolean hasData()
      Returns if this frame has data.
      if this frame's data can be considered valid
    • clearData

      public void clearData()
      Flag that this frame's data is not valid.
    • getData

      public byte[] getData()
      Gets the underlying byte array data.
      the byte array data as a type.
    • updateData

      public void updateData(byte[] data, double timestamp)
      Update the ByteArrayFrame with new byte array data.
      data - the new data to update with
      timestamp - the timestamp at which it occured