Package io.deephaven.base
Class RingBuffer<E>
java.lang.Object
io.deephaven.base.RingBuffer<E>
- All Implemented Interfaces:
Iterable<E>
A trivial circular buffer, like java.util.concurrent.ArrayBlockingQueue but without all the synchronization and
collection cruft.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addOverwrite
(E e) back()
int
capacity()
void
clear()
element()
void
front()
front
(int offset) boolean
isEmpty()
boolean
isFull()
iterator()
boolean
boolean
offerFirst
(E e) peek()
peek
(int offset) peekLast()
peekLast
(int offset) poll()
remove()
removeAtSwapLast
(int offset) int
size()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
spliterator
-
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
-
addFirst
-
addOverwrite
-
offer
-
offerFirst
-
remove
-
poll
-
element
-
peek
-
peek
-
front
-
front
-
removeAtSwapLast
-
back
-
peekLast
-
peekLast
-
iterator
-
forEach
-