E
- the contained value typepublic class MpscLinkedQueue<E> extends AbstractQueue<E> implements BiPredicate<E,E>
Constructor and Description |
---|
MpscLinkedQueue() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
boolean |
offer(E e)
|
E |
peek() |
E |
poll()
|
boolean |
remove(Object o) |
int |
size() |
boolean |
test(E e1,
E e2)
This is an additional
Queue extension for
Queue.offer(E) which allows atomically offer two elements at once. |
add, addAll, element, remove
contains, containsAll, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
and, negate, or
contains, containsAll, equals, hashCode, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
public final boolean offer(E e)
IMPLEMENTATION NOTES:
Offer is allowed from multiple threads.
Offer allocates a new node and:
offer
in interface Queue<E>
Queue.offer(java.lang.Object)
public boolean test(E e1, E e2)
Queue
extension for
Queue.offer(E)
which allows atomically offer two elements at once.
IMPLEMENTATION NOTES:
Offer over test(E, E)
is allowed from multiple threads.
Offer over test(E, E)
allocates a two new nodes and:
test
in interface BiPredicate<E,E>
e1
- first element to offere2
- second element to offerQueue.offer(java.lang.Object)
@Nullable public E poll()
IMPLEMENTATION NOTES:
Poll is allowed from a SINGLE thread.
Poll reads the next node from the consumerNode and:
poll
in interface Queue<E>
Queue.poll()
public boolean remove(Object o)
remove
in interface Collection<E>
remove
in class AbstractCollection<E>
public void clear()
clear
in interface Collection<E>
clear
in class AbstractQueue<E>
public int size()
size
in interface Collection<E>
size
in class AbstractCollection<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in class AbstractCollection<E>