Class RingBuffer<E>

java.lang.Object
io.deephaven.base.RingBuffer<E>
All Implemented Interfaces:
Iterable<E>

public class RingBuffer<E> extends Object implements Iterable<E>
A trivial circular buffer, like java.util.concurrent.ArrayBlockingQueue but without all the synchronization and collection cruft.
  • Constructor Details

    • RingBuffer

      public RingBuffer(int capacity)
  • Method Details

    • isFull

      public boolean isFull()
    • isEmpty

      public boolean isEmpty()
    • size

      public int size()
    • clear

      public void clear()
    • capacity

      public int capacity()
    • add

      public boolean add(E e)
    • addFirst

      public boolean addFirst(E e)
    • addOverwrite

      public E addOverwrite(E e)
    • offer

      public boolean offer(E e)
    • offerFirst

      public boolean offerFirst(E e)
    • remove

      public E remove()
    • poll

      public E poll()
    • element

      public E element()
    • peek

      public E peek()
    • peek

      public E peek(int offset)
    • front

      public E front()
    • front

      public E front(int offset)
    • removeAtSwapLast

      public E removeAtSwapLast(int offset)
    • back

      public E back()
    • peekLast

      public E peekLast()
    • peekLast

      public E peekLast(int offset)
    • iterator

      public RingBuffer<E>.Iterator iterator()
      Specified by:
      iterator in interface Iterable<E>
    • forEach

      public void forEach(Consumer<? super E> action)
      Specified by:
      forEach in interface Iterable<E>