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
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddOverwrite(E e) back()intcapacity()voidclear()element()voidfront()front(int offset) booleanisEmpty()booleanisFull()iterator()booleanbooleanofferFirst(E e) peek()peek(int offset) peekLast()peekLast(int offset) poll()remove()removeAtSwapLast(int offset) intsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-