Class CircularArray_F32


public class CircularArray_F32
extends Object
A circular queue which can grow as needed.
  • Field Details

    • data

      public float[] data
    • start

      public int start
    • size

      public int size
  • Constructor Details

    • CircularArray_F32

      public CircularArray_F32()
    • CircularArray_F32

      public CircularArray_F32​(int dataSize)
  • Method Details

    • reset

      public void reset()
    • popHead

      public float popHead()
      Returns and removes the first element from the queue.
      first element in the queue
    • popTail

      public float popTail()
      Returns and removes the last element from the queue.
      last element in the queue
    • head

      public float head()
      Value of the first element in the queue
    • tail

      public float tail()
      Value of the last element in the queue
    • removeHead

      public void removeHead()
      Removes the first element
    • removeTail

      public void removeTail()
      Removes the last element
    • get

      public float get​(int index)
      Returns the element in the queue at index. No bounds check is performed and a garbage value might be returned.
      index - Which element in the queue you wish to access
      the element's value
    • add

      public void add​(float value)
      Adds a new element to the queue, but if the queue is full write over the oldest element.
      value - Value which is to be added
    • set

      public void set​(CircularArray_F32 original)
    • copy

      public CircularArray_F32 copy()
    • resizeQueue

      public void resizeQueue​(int maxSize)
    • queueSize

      public int queueSize()
    • size

      public int size()
    • isEmpty

      public boolean isEmpty()
    • isFull

      public boolean isFull()