E
- element type in the queue.public class ManyToOneConcurrentLinkedQueue<E>
extends java.lang.Object
implements java.util.Queue<E>
Queue
that can be used from many producers and a single consumer.
This is a Java port of Dmitry Vyukov's MPSC linked queue.
Note: This queue breaks the contract for peek and poll in that it can return null when the queue has no node
available but is not empty. This is a conflated design issue in the Queue implementation. If you wish to check for
empty then call isEmpty()
.
Modifier and Type | Field and Description |
---|---|
protected org.agrona.concurrent.ManyToOneConcurrentLinkedQueuePadding1.Node<E> |
head |
protected static long |
HEAD_OFFSET |
protected static long |
NEXT_OFFSET |
protected long |
p1 |
protected long |
p10 |
protected long |
p11 |
protected long |
p12 |
protected long |
p13 |
protected long |
p14 |
protected long |
p15 |
protected long |
p16 |
protected long |
p17 |
protected long |
p18 |
protected long |
p19 |
protected long |
p2 |
protected long |
p20 |
protected long |
p21 |
protected long |
p22 |
protected long |
p23 |
protected long |
p24 |
protected long |
p25 |
protected long |
p26 |
protected long |
p27 |
protected long |
p28 |
protected long |
p29 |
protected long |
p3 |
protected long |
p30 |
protected long |
p31 |
protected long |
p32 |
protected long |
p33 |
protected long |
p34 |
protected long |
p35 |
protected long |
p36 |
protected long |
p37 |
protected long |
p38 |
protected long |
p39 |
protected long |
p4 |
protected long |
p40 |
protected long |
p41 |
protected long |
p42 |
protected long |
p43 |
protected long |
p44 |
protected long |
p45 |
protected long |
p5 |
protected long |
p6 |
protected long |
p7 |
protected long |
p8 |
protected long |
p9 |
protected org.agrona.concurrent.ManyToOneConcurrentLinkedQueuePadding1.Node<E> |
tail |
protected static long |
TAIL_OFFSET |
Constructor and Description |
---|
ManyToOneConcurrentLinkedQueue() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e) |
boolean |
addAll(java.util.Collection<? extends E> c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
E |
element() |
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
boolean |
offer(E e) |
E |
peek() |
E |
poll() |
E |
remove() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size()
Size can be considered an approximation on a moving list.
|
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected long p31
protected long p32
protected long p33
protected long p34
protected long p35
protected long p36
protected long p37
protected long p38
protected long p39
protected long p40
protected long p41
protected long p42
protected long p43
protected long p44
protected long p45
protected volatile org.agrona.concurrent.ManyToOneConcurrentLinkedQueuePadding1.Node<E> head
protected long p16
protected long p17
protected long p18
protected long p19
protected long p20
protected long p21
protected long p22
protected long p23
protected long p24
protected long p25
protected long p26
protected long p27
protected long p28
protected long p29
protected long p30
protected volatile org.agrona.concurrent.ManyToOneConcurrentLinkedQueuePadding1.Node<E> tail
protected static final long HEAD_OFFSET
protected static final long TAIL_OFFSET
protected static final long NEXT_OFFSET
protected long p1
protected long p2
protected long p3
protected long p4
protected long p5
protected long p6
protected long p7
protected long p8
protected long p9
protected long p10
protected long p11
protected long p12
protected long p13
protected long p14
protected long p15
public boolean add(E e)
public int size()
isEmpty()
is a better alternative.
This operation is O(n) on the length of the linked chain.
size
in interface java.util.Collection<E>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<E>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<E>
public java.util.Iterator<E> iterator()
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<E>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<E>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<E>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<E>
public boolean addAll(java.util.Collection<? extends E> c)
addAll
in interface java.util.Collection<E>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<E>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<E>
public void clear()
clear
in interface java.util.Collection<E>
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.