public final class SpscLinkedArrayQueue<T> extends Objectimplements Queue <T>
| Modifier and Type | Field and Description |
|---|---|
protected AtomicReferenceArray |
consumerBuffer
|
protected long |
consumerIndex
|
protected int |
consumerMask
|
protected AtomicReferenceArray |
producerBuffer
|
protected long |
producerIndex
|
protected long |
producerLookAhead
|
protected int |
producerLookAheadStep
|
protected int |
producerMask
|
| Constructor and Description |
|---|
SpscLinkedArrayQueue(int bufferSize)
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T e)
|
boolean |
addAll(Collection
|
void |
clear()
|
boolean |
contains(Object
|
boolean |
containsAll(Collection
|
T |
element()
|
boolean |
isEmpty()
|
Iterator |
iterator()
|
boolean |
offer(T e)
|
boolean |
offer(T first, T second)
Offer two elements at the same time.
|
T |
peek()
|
T |
poll()
|
T |
remove()
|
boolean |
remove(Object
|
boolean |
removeAll(Collection
|
boolean |
retainAll(Collection
|
int |
size()
|
Object |
toArray()
|
<E> E[] |
toArray(E[] a)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCode, parallelStream, removeIf, spliterator, streamprotected volatile long producerIndex
protected int producerLookAheadStep
protected long producerLookAhead
protected int producerMask
protected AtomicReferenceArray<Object > producerBuffer
protected int consumerMask
protected AtomicReferenceArray<Object > consumerBuffer
protected volatile long consumerIndex
public final boolean offer(T e)
This implementation is correct for single producer thread use only.
public final T poll()
This implementation is correct for single consumer thread use only.
public final T peek()
This implementation is correct for single consumer thread use only.
public void clear()
public final int size()
public boolean isEmpty()
public boolean contains(Objecto)
public Object[] toArray()
public <E> E[] toArray(E[] a)
public boolean remove(Objecto)
public boolean containsAll(Collection<?> c)
public boolean addAll(Collection<? extends T> c)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public boolean add(T e)
public T remove()
public T element()