T - the contained value typepublic final class MpscLinkedQueue<T> extends Object implements Queue<T>
| Constructor and Description |
|---|
MpscLinkedQueue() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T t) |
boolean |
addAll(Collection<? extends T> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
T |
element() |
boolean |
isEmpty()
|
Iterator<T> |
iterator() |
boolean |
offer(T e)
|
T |
peek() |
T |
poll()
|
T |
remove() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<T1> T1[] |
toArray(T1[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCode, parallelStream, removeIf, spliterator, streampublic boolean add(T t)
public boolean remove(Object o)
remove in interface Collection<T>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<T>public boolean addAll(Collection<? extends T> c)
addAll in interface Collection<T>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<T>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<T>public boolean offer(T e)
IMPLEMENTATION NOTES:
Offer is allowed from multiple threads.
Offer allocates a new node and:
offer in interface Queue<T>Queue.offer(Object)public T poll()
IMPLEMENTATION NOTES:
Poll is allowed from a SINGLE thread.
Poll reads the next node from the consumerNode and:
poll in interface Queue<T>Queue.poll()public void clear()
clear in interface Collection<T>public int size()
size in interface Collection<T>public boolean isEmpty()
IMPLEMENTATION NOTES:
Queue is empty when producerNode is the same as consumerNode. An alternative implementation would be to observe
the producerNode.value is null, which also means an empty queue because only the consumerNode.value is allowed to
be null.
isEmpty in interface Collection<T>public boolean contains(Object o)
contains in interface Collection<T>public Object[] toArray()
toArray in interface Collection<T>public <T1> T1[] toArray(T1[] a)
toArray in interface Collection<T>Copyright © 2019–2020 SmallRye. All rights reserved.