E - IndexedQueueSizeUtil.IndexedQueue, MessagePassingQueue<E>, QueueProgressIndicatorsConcurrentSequencedCircularArrayQueue, MpscArrayQueue, SpmcArrayQueue, SpscArrayQueuepublic abstract class ConcurrentCircularArrayQueue<E>
extends java.util.AbstractQueue<E>
MessagePassingQueue.Consumer<T>, MessagePassingQueue.ExitCondition, MessagePassingQueue.Supplier<T>, MessagePassingQueue.WaitStrategy| Modifier and Type | Field | Description |
|---|---|---|
protected E[] |
buffer |
|
protected long |
mask |
UNBOUNDED_CAPACITY| Constructor | Description |
|---|---|
ConcurrentCircularArrayQueue(int capacity) |
| Modifier and Type | Method | Description |
|---|---|---|
protected long |
calcElementOffset(long index) |
|
protected static long |
calcElementOffset(long index,
long mask) |
|
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() |
|
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, toArraycontains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArraylvConsumerIndex, lvProducerIndexdrain, drain, drain, fill, fill, fill, offer, peek, poll, relaxedOffer, relaxedPeek, relaxedPollprotected final long mask
protected final E[] buffer
protected static long calcElementOffset(long index,
long mask)
index - desirable element indexmask - (length - 1)protected final long calcElementOffset(long index)
index - desirable element indexpublic java.util.Iterator<E> iterator()
iterator in class java.util.AbstractCollection<E>public final int size()
MessagePassingQueuesize in interface MessagePassingQueue<E>size in class java.util.AbstractCollection<E>Integer.MAX_VALUE but less or equals to
capacity (if bounded).public final boolean isEmpty()
MessagePassingQueueisEmpty 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 MessagePassingQueue<E>clear in class java.util.AbstractQueue<E>public int capacity()
MessagePassingQueue.UNBOUNDED_CAPACITY if not boundedpublic final long currentProducerIndex()
QueueProgressIndicatorspublic final long currentConsumerIndex()
QueueProgressIndicatorsCopyright © 2013–2017. All rights reserved.