public class PushPullConcurrentQueue<E> extends Object implements ConcurrentQueue<E>
| Constructor and Description |
|---|
PushPullConcurrentQueue(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
int |
capacity() |
void |
clear()
clear the queue of all elements
|
boolean |
contains(Object o) |
boolean |
isEmpty() |
boolean |
offer(E e)
Add element t to the ring
|
E |
peek()
return the first element in the queue
|
E |
poll()
remove the first element from the queue and return it
|
int |
remove(E[] e)
return all elements in the queue to the provided array, up to the size of the provided
array.
|
int |
size()
This implemention is known to be broken if preemption were to occur after
reading the tail pointer.
|
public boolean offer(E e)
ConcurrentQueueoffer in interface ConcurrentQueue<E>e - - element to offerpublic E poll()
ConcurrentQueuepoll in interface ConcurrentQueue<E>public int remove(E[] e)
ConcurrentQueueremove in interface ConcurrentQueue<E>e - - The element arraypublic void clear()
ConcurrentQueueclear in interface ConcurrentQueue<E>public final E peek()
ConcurrentQueuepeek in interface ConcurrentQueue<E>public final int size()
size in interface ConcurrentQueue<E>public int capacity()
capacity in interface ConcurrentQueue<E>public final boolean isEmpty()
isEmpty in interface ConcurrentQueue<E>public final boolean contains(Object o)
contains in interface ConcurrentQueue<E>o - - the object to testCopyright © 2012–2018 Conversant Engineering. All rights reserved.