E
- public abstract class ConcurrentCircularArrayQueue<E> extends AbstractQueue<E>
Offset calculation is separate from access to enable the reuse of a give compute offset.
Load/Store methods using a buffer parameter are provided to allow the prevention of final field reload after a LoadLoad barrier.
MessagePassingQueue.Consumer<T>, MessagePassingQueue.ExitCondition, MessagePassingQueue.Supplier<T>, MessagePassingQueue.WaitStrategy
Modifier and Type | Field and Description |
---|---|
protected E[] |
buffer |
protected long |
mask |
UNBOUNDED_CAPACITY
Constructor and Description |
---|
ConcurrentCircularArrayQueue(int capacity) |
Modifier and Type | Method and Description |
---|---|
protected long |
calcElementOffset(long index) |
protected static long |
calcElementOffset(long index,
long mask) |
int |
capacity() |
void |
clear()
Removes all items from the queue.
|
Iterator<E> |
iterator() |
add, addAll, element, remove
contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
drain, drain, drain, fill, fill, fill, isEmpty, offer, peek, poll, relaxedOffer, relaxedPeek, relaxedPoll, size
contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
protected final long mask
protected final E[] buffer
protected final long calcElementOffset(long index)
index
- desirable element indexprotected static long calcElementOffset(long index, long mask)
index
- desirable element indexmask
- public Iterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in class AbstractCollection<E>
public void clear()
MessagePassingQueue
Collection.clear()
interface.clear
in interface Collection<E>
clear
in interface MessagePassingQueue<E>
clear
in class AbstractQueue<E>
public int capacity()
Copyright © 2013-2016. All Rights Reserved.