Class Buffer<E>

java.lang.Object
nl.colorize.multimedialib.math.Buffer<E>
Type Parameters:
E - The type of element that is stored in the queue.

public class Buffer<E> extends Object
Data structure that can be flushed to obtain values that have accumulated over time. This is suitable for events that should be handled during each frame update, but that can occur at any point.
  • Constructor Details

    • Buffer

      public Buffer()
  • Method Details

    • push

      public void push(E element)
    • push

      public void push(List<E> elements)
    • push

      public void push(E[] elements)
    • remove

      public void remove(E element)
    • flush

      public Iterable<E> flush()
      Returns all elements that were pushed to the queue since the last time this method was called, then clears the queue. This method exists to support frame-by-frame polling.
    • clear

      public void clear()
      Removes all contents from this buffer. This method is the same as calling flush() and ignoring the result.
    • toString

      public String toString()
      Overrides:
      toString in class Object