public class SpscGrowableArrayQueue<E> extends AbstractQueue<E> implements QueueProgressIndicators
Modifier and Type | Field and Description |
---|---|
protected E[] |
consumerBuffer |
protected long |
consumerIndex |
protected long |
consumerMask |
protected int |
maxQueueCapacity |
protected E[] |
producerBuffer |
protected long |
producerIndex |
protected long |
producerLookAhead |
protected int |
producerLookAheadStep |
protected long |
producerMask |
Constructor and Description |
---|
SpscGrowableArrayQueue(int maxCapacity) |
SpscGrowableArrayQueue(int initialCapacity,
int maxCapacity) |
Modifier and Type | Method and Description |
---|---|
long |
currentConsumerIndex()
This method has no concurrent visibility semantics.
|
long |
currentProducerIndex()
This method has no concurrent visibility semantics.
|
Iterator<E> |
iterator() |
boolean |
offer(E e) |
E |
peek() |
E |
poll() |
int |
size() |
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
protected long consumerIndex
protected long consumerMask
protected E[] consumerBuffer
protected int maxQueueCapacity
protected int producerLookAheadStep
protected long producerLookAhead
protected long producerMask
protected E[] producerBuffer
protected long producerIndex
public SpscGrowableArrayQueue(int maxCapacity)
public SpscGrowableArrayQueue(int initialCapacity, int maxCapacity)
public final Iterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in class AbstractCollection<E>
public final boolean offer(E e)
This implementation is correct for single producer thread use only.
public final E poll()
This implementation is correct for single consumer thread use only.
public final E peek()
This implementation is correct for single consumer thread use only.
public final int size()
size
in interface Collection<E>
size
in class AbstractCollection<E>
public long currentProducerIndex()
QueueProgressIndicators
currentProducerIndex
in interface QueueProgressIndicators
public long currentConsumerIndex()
QueueProgressIndicators
currentConsumerIndex
in interface QueueProgressIndicators
Copyright © 2013-2019. All Rights Reserved.