public class KeyedPriorityBlockingQueue<E> extends Object
Constructor and Description |
---|
KeyedPriorityBlockingQueue() |
Modifier and Type | Method and Description |
---|---|
void |
enqueue(E element,
int priority)
Add an element to the queue.
|
boolean |
isEmpty()
Returns true if the queue is empty; false otherwise.
|
E |
take()
Retrieves and removes the head of this queue, waiting if necessary
until an element becomes available.
|
public void enqueue(E element, int priority)
element
- element to enqueue.priority
- priority of the element.public E take() throws InterruptedException
InterruptedException
- if interrupted while waitingpublic boolean isEmpty()