public abstract class ConcurrentSequencedCircularArrayQueue<E> extends ConcurrentCircularArrayQueue<E>
Modifier and Type | Field and Description |
---|---|
protected static int |
SEQ_BUFFER_PAD |
protected long[] |
sequenceBuffer |
buffer, mask, REF_BUFFER_PAD, SPARSE_SHIFT
Constructor and Description |
---|
ConcurrentSequencedCircularArrayQueue(int capacity) |
Modifier and Type | Method and Description |
---|---|
protected long |
calcSequenceOffset(long index) |
protected static long |
calcSequenceOffset(long index,
long mask) |
boolean |
isEmpty()
This method's accuracy is subject to concurrent modifications happening as the observation is carried out.
|
protected long |
lvSequence(long[] buffer,
long offset) |
boolean |
offer(M message)
Called from a producer thread subject to the restrictions appropriate to the implementation and according to the
Queue.offer(Object) interface. |
M |
peek()
Called from the consumer thread subject to the restrictions appropriate to the implementation and according to
the
Queue.peek() interface. |
M |
poll()
Called from the consumer thread subject to the restrictions appropriate to the implementation and according to
the
Queue.poll() interface. |
int |
size()
This method's accuracy is subject to concurrent modifications happening as the size is estimated and as such is a
best effort rather than absolute value.
|
protected void |
soSequence(long[] buffer,
long offset,
long e) |
calcElementOffset, calcElementOffset, clear, iterator, lpElement, lpElement, lvElement, lvElement, soElement, soElement, spElement, spElement
add, addAll, element, remove
contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
protected static final int SEQ_BUFFER_PAD
protected final long[] sequenceBuffer
public ConcurrentSequencedCircularArrayQueue(int capacity)
protected final long calcSequenceOffset(long index)
protected static final long calcSequenceOffset(long index, long mask)
protected final void soSequence(long[] buffer, long offset, long e)
protected final long lvSequence(long[] buffer, long offset)
public boolean offer(M message)
Queue.offer(Object)
interface.message
- public M poll()
Queue.poll()
interface.public M peek()
Queue.peek()
interface.public int size()
Integer.MAX_VALUE
if not boundedpublic boolean isEmpty()
Copyright © 2013–2016. All rights reserved.