T
- the value type held by this queuepublic 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<? extends T> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
T |
element() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
boolean |
offer(T value) |
T |
peek() |
T |
poll() |
T |
remove() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
accumulateAndGet, compareAndSet, get, getAndAccumulate, getAndSet, getAndUpdate, lazySet, length, set, toString, updateAndGet, weakCompareAndSet
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
public void clear()
clear
in interface Collection<T>
public boolean isEmpty()
isEmpty
in interface Collection<T>
public int size()
size
in interface Collection<T>
public boolean contains(Object o)
contains
in interface Collection<T>
public Object[] toArray()
toArray
in interface Collection<T>
public <E> E[] toArray(E[] a)
toArray
in interface Collection<T>
public boolean remove(Object o)
remove
in interface Collection<T>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<T>
public boolean addAll(Collection<? extends T> c)
addAll
in interface Collection<T>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<T>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<T>
public boolean add(T e)
Copyright © 2017. All rights reserved.