public static class PriorityQueues.EmptyPriorityQueue extends AbstractPriorityQueue
This class may be useful to implement your own in case you subclass
PriorityQueue.
| Modifier and Type | Method and Description |
|---|---|
void |
changed()
Notifies the queue that the first element has changed (optional operation).
|
void |
clear()
Removes all elements from this queue.
|
Comparator<?> |
comparator()
Returns the comparator associated with this queue, or
null if it uses its elements' natural ordering. |
Object |
dequeue()
Dequeues the first element from the queue.
|
void |
enqueue(Object o)
Enqueues a new element.
|
Object |
first()
Returns the first element of the queue.
|
boolean |
isEmpty()
Checks whether the queue is empty.
|
Object |
last()
Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).
|
int |
size()
Returns the number of elements in this queue.
|
public void enqueue(Object o)
PriorityQueueo - the element to enqueue..public Object dequeue()
PriorityQueuepublic boolean isEmpty()
PriorityQueueisEmpty in interface PriorityQueueisEmpty in class AbstractPriorityQueuepublic int size()
PriorityQueuepublic void clear()
PriorityQueuepublic Object first()
PriorityQueuepublic Object last()
PriorityQueuelast in interface PriorityQueuelast in class AbstractPriorityQueuepublic void changed()
PriorityQueuechanged in interface PriorityQueuechanged in class AbstractPriorityQueuepublic Comparator<?> comparator()
PriorityQueuenull if it uses its elements' natural ordering.null if it uses its elements' natural ordering.