PriorityQueue, java.io.Serializablepublic static class PriorityQueues.EmptyPriorityQueue extends java.lang.Object implements PriorityQueue, java.io.Serializable
This class may be useful to implement your own in case you subclass
PriorityQueue.
| Modifier and Type | Method | Description |
|---|---|---|
void |
changed() |
Notifies the queue that the first element has changed (optional operation).
|
void |
clear() |
Removes all elements from this queue.
|
java.lang.Object |
clone() |
|
java.util.Comparator<?> |
comparator() |
Returns the comparator associated with this queue, or
null if it uses its elements' natural ordering. |
java.lang.Object |
dequeue() |
Dequeues the first element from the queue.
|
void |
enqueue(java.lang.Object o) |
Enqueues a new element.
|
boolean |
equals(java.lang.Object o) |
|
java.lang.Object |
first() |
Returns the first element of the queue.
|
int |
hashCode() |
|
boolean |
isEmpty() |
Checks whether this queue is empty.
|
java.lang.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(java.lang.Object o)
PriorityQueueenqueue in interface PriorityQueueo - the element to enqueue.public java.lang.Object dequeue()
PriorityQueuedequeue in interface PriorityQueuepublic boolean isEmpty()
PriorityQueueThis default implementation checks whether PriorityQueue.size() is zero.
isEmpty in interface PriorityQueuepublic int size()
PriorityQueuesize in interface PriorityQueuepublic void clear()
PriorityQueueclear in interface PriorityQueuepublic java.lang.Object first()
PriorityQueuefirst in interface PriorityQueuepublic java.lang.Object last()
PriorityQueueThis default implementation just throws an UnsupportedOperationException.
last in interface PriorityQueuepublic void changed()
PriorityQueueThis default implementation just throws an UnsupportedOperationException.
changed in interface PriorityQueuepublic java.util.Comparator<?> comparator()
PriorityQueuenull if it uses its elements' natural ordering.comparator in interface PriorityQueuenull if it uses its elements' natural ordering.public java.lang.Object clone()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object