public abstract class ConcurrentSequencedCircularUnpaddedArrayQueue<E> extends AbstractQueue<E>
MessagePassingQueue.Consumer<T>, MessagePassingQueue.ExitCondition, MessagePassingQueue.Supplier<T>, MessagePassingQueue.WaitStrategy| Modifier and Type | Field and Description |
|---|---|
protected E[] |
buffer |
protected long |
mask |
protected long[] |
sequenceBuffer |
UNBOUNDED_CAPACITY| Constructor and Description |
|---|
ConcurrentSequencedCircularUnpaddedArrayQueue(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
int |
capacity() |
void |
clear()
Removes all items from the queue.
|
long |
currentConsumerIndex()
This method has no concurrent visibility semantics.
|
long |
currentProducerIndex()
This method has no concurrent visibility semantics.
|
boolean |
isEmpty()
This method's accuracy is subject to concurrent modifications happening as the observation is carried
out.
|
Iterator<E> |
iterator()
Get an iterator for this queue.
|
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.
|
String |
toString() |
add, addAll, element, removecontains, containsAll, remove, removeAll, retainAll, toArray, toArrayclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdrain, drain, drain, fill, fill, fill, offer, peek, poll, relaxedOffer, relaxedPeek, relaxedPolllvConsumerIndex, lvProducerIndexcontains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArrayprotected final long[] sequenceBuffer
protected final long mask
protected final E[] buffer
public ConcurrentSequencedCircularUnpaddedArrayQueue(int capacity)
public int size()
MessagePassingQueuesize in interface Collection<E>size in interface MessagePassingQueue<E>size in class AbstractCollection<E>Integer.MAX_VALUE but less or equals to
capacity (if bounded).public boolean isEmpty()
MessagePassingQueueisEmpty in interface Collection<E>isEmpty in interface MessagePassingQueue<E>isEmpty in class AbstractCollection<E>public String toString()
toString in class AbstractCollection<E>public void clear()
MessagePassingQueueCollection.clear() interface.clear in interface Collection<E>clear in interface MessagePassingQueue<E>clear in class AbstractQueue<E>public int capacity()
capacity in interface IndexedQueueSizeUtil.IndexedQueuecapacity in interface MessagePassingQueue<E>MessagePassingQueue.UNBOUNDED_CAPACITY if not boundedpublic long currentProducerIndex()
QueueProgressIndicatorscurrentProducerIndex in interface QueueProgressIndicatorspublic long currentConsumerIndex()
QueueProgressIndicatorscurrentConsumerIndex in interface QueueProgressIndicatorspublic Iterator<E> iterator()
The iterator provides a best-effort snapshot of the elements in the queue. The returned iterator is not guaranteed to return elements in queue order, and races with the consumer thread may cause gaps in the sequence of returned elements. Like {link #relaxedPoll}, the iterator may not immediately return newly inserted elements.
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in class AbstractCollection<E>Copyright © 2013–2024. All rights reserved.