public final class SpscExactAtomicArrayQueue<T> extends AtomicReferenceArray<T> implements Queue <T>
This means that a queue of 10 will allow exactly 10 offers, however, the underlying storage is still power-of-2.
The implementation uses field updaters and thus should be platform-safe.
| Constructor and Description |
|---|
SpscExactAtomicArrayQueue(int capacity)
|
| 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 value)
|
T |
peek()
|
T |
poll()
|
T |
remove()
|
boolean |
remove(Object
|
boolean |
removeAll(Collection
|
boolean |
retainAll(Collection
|
int |
size()
|
Object |
toArray()
|
<E> E[] |
toArray(E[] a)
|
accumulateAndGet, compareAndSet, get, getAndAccumulate, getAndSet, getAndUpdate, lazySet, length, set, toString, updateAndGet, weakCompareAndSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequals, hashCode, parallelStream, removeIf, spliterator, streampublic boolean offer(T value)
public T poll()
public T peek()
public void clear()
public boolean isEmpty()
public int size()
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()