E - the element type of the queuepublic final class SpscLinkedArrayQueue<E> extends AbstractQueue<E> implements Queue<E>
Code inspired from https://github.com/JCTools/JCTools/blob/master/jctools-core/src/main/java/org/jctools/queues/atomic.
| Constructor and Description |
|---|
SpscLinkedArrayQueue(int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
boolean |
offer(E e) |
boolean |
offer(E first,
E second)
Offer two elements at the same time.
|
E |
peek() |
E |
poll() |
static int |
roundToPowerOfTwo(int value)
Find the next larger positive power of two value up from the given value.
|
int |
size() |
add, addAll, element, removecontains, containsAll, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArraypublic static int roundToPowerOfTwo(int value)
value - from which next positive power of two will be found.public boolean offer(E e)
This implementation is correct for single producer thread use only.
public E poll()
This implementation is correct for single consumer thread use only.
public void clear()
clear in interface Collection<E>clear in class AbstractQueue<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in class AbstractCollection<E>public int size()
size in interface Collection<E>size in class AbstractCollection<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in class AbstractCollection<E>Copyright © 2023 JBoss by Red Hat. All rights reserved.