public abstract class AbstractNodeQueue<T> extends java.util.concurrent.atomic.AtomicReference<AbstractNodeQueue.Node<T>>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractNodeQueue.Node<T> |
Modifier | Constructor and Description |
---|---|
protected |
AbstractNodeQueue() |
Modifier and Type | Method and Description |
---|---|
void |
add(T value)
Add an element to the head of the queue.
|
void |
addNode(AbstractNodeQueue.Node<T> n)
Add an element to the head of the queue, providing the queue node to be used.
|
int |
count()
This method returns an upper bound on the queue size at the time it
starts executing.
|
boolean |
isEmpty()
Query the queue whether it is empty right now.
|
T |
peek()
Query the queue tail for the next element without dequeuing it.
|
protected AbstractNodeQueue.Node<T> |
peekNode()
Query the queue tail for the next element without dequeuing it.
|
T |
poll()
Pull one item from the queue’s tail if there is one.
|
AbstractNodeQueue.Node<T> |
pollNode()
Pull one item from the queue, returning it within a queue node.
|
protected final AbstractNodeQueue.Node<T> peekNode()
public final T peek()
public final void add(T value)
value
- the element to be added; must not be nullpublic final void addNode(AbstractNodeQueue.Node<T> n)
n
- the node containing the element to be added; both must not be nullpublic final boolean isEmpty()
public final int count()
public final T poll()
public final AbstractNodeQueue.Node<T> pollNode()