abstract class ConcurrentCircularUnpaddedArrayQueue<E> extends ConcurrentCircularUnpaddedArrayQueueL0Pad<E> implements MessagePassingQueue<E>, IndexedQueueSizeUtil.IndexedQueue, QueueProgressIndicators, SupportsIterator
| Modifier and Type | Class and Description |
|---|---|
private static class |
ConcurrentCircularUnpaddedArrayQueue.WeakIterator<E> |
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 |
|---|
ConcurrentCircularUnpaddedArrayQueue(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.
|
java.util.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.
|
java.lang.String |
toString() |
contains, 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, lvProducerIndexprotected final long mask
protected final E[] buffer
ConcurrentCircularUnpaddedArrayQueue(int capacity)
public int size()
MessagePassingQueuesize in interface java.util.Collection<E>size in interface MessagePassingQueue<E>size in class java.util.AbstractCollection<E>Integer.MAX_VALUE but less or equals to
capacity (if bounded).public boolean isEmpty()
MessagePassingQueueisEmpty in interface java.util.Collection<E>isEmpty in interface MessagePassingQueue<E>isEmpty in class java.util.AbstractCollection<E>public java.lang.String toString()
toString in class java.util.AbstractCollection<E>public void clear()
MessagePassingQueueCollection.clear() interface.clear in interface java.util.Collection<E>clear in interface MessagePassingQueue<E>clear in class java.util.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 java.util.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.