T - The object that is maintained in the queue.public final class DefaultPriorityQueue<T extends PriorityQueueNode> extends AbstractQueue<T> implements PriorityQueue<T>
PriorityQueueNode for the purpose of maintaining the index in the priority queue.| Constructor and Description |
|---|
DefaultPriorityQueue(Comparator<T> comparator,
int initialSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
clearIgnoringIndexes()
Removes all of the elements from this
PriorityQueue without calling
PriorityQueueNode.priorityQueueIndex(DefaultPriorityQueue) or explicitly removing references to them to
allow them to be garbage collected. |
boolean |
contains(Object o) |
boolean |
containsTyped(T node)
Same as
Collection.contains(Object) but typed using generics. |
boolean |
isEmpty() |
Iterator<T> |
iterator()
This iterator does not return elements in any particular order.
|
boolean |
offer(T e) |
T |
peek() |
T |
poll() |
void |
priorityChanged(T node)
Notify the queue that the priority for
node has changed. |
boolean |
remove(Object o) |
boolean |
removeTyped(T node)
Same as
Collection.remove(Object) but typed using generics. |
int |
size() |
Object[] |
toArray() |
<X> X[] |
toArray(X[] a) |
add, addAll, element, removecontainsAll, removeAll, retainAll, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAll, containsAll, equals, hashCode, parallelStream, removeAll, removeIf, retainAll, spliterator, streampublic DefaultPriorityQueue(Comparator<T> comparator, int initialSize)
public int size()
size in interface Collection<T extends PriorityQueueNode>size in class AbstractCollection<T extends PriorityQueueNode>public boolean isEmpty()
isEmpty in interface Collection<T extends PriorityQueueNode>isEmpty in class AbstractCollection<T extends PriorityQueueNode>public boolean contains(Object o)
contains in interface Collection<T extends PriorityQueueNode>contains in class AbstractCollection<T extends PriorityQueueNode>public boolean containsTyped(T node)
PriorityQueueCollection.contains(Object) but typed using generics.containsTyped in interface PriorityQueue<T extends PriorityQueueNode>public void clear()
clear in interface Collection<T extends PriorityQueueNode>clear in class AbstractQueue<T extends PriorityQueueNode>public void clearIgnoringIndexes()
PriorityQueuePriorityQueue without calling
PriorityQueueNode.priorityQueueIndex(DefaultPriorityQueue) or explicitly removing references to them to
allow them to be garbage collected. This should only be used when it is certain that the nodes will not be
re-inserted into this or any other PriorityQueue and it is known that the PriorityQueue itself
will be garbage collected after this call.clearIgnoringIndexes in interface PriorityQueue<T extends PriorityQueueNode>public boolean offer(T e)
offer in interface Queue<T extends PriorityQueueNode>public T poll()
poll in interface Queue<T extends PriorityQueueNode>public T peek()
peek in interface Queue<T extends PriorityQueueNode>public boolean remove(Object o)
remove in interface Collection<T extends PriorityQueueNode>remove in class AbstractCollection<T extends PriorityQueueNode>public boolean removeTyped(T node)
PriorityQueueCollection.remove(Object) but typed using generics.removeTyped in interface PriorityQueue<T extends PriorityQueueNode>public void priorityChanged(T node)
PriorityQueuenode has changed. The queue will adjust to ensure the priority
queue properties are maintained.priorityChanged in interface PriorityQueue<T extends PriorityQueueNode>node - An object which is in this queue and the priority may have changed.public Object[] toArray()
toArray in interface Collection<T extends PriorityQueueNode>toArray in class AbstractCollection<T extends PriorityQueueNode>public <X> X[] toArray(X[] a)
toArray in interface Collection<T extends PriorityQueueNode>toArray in class AbstractCollection<T extends PriorityQueueNode>public Iterator<T> iterator()
iterator in interface Iterable<T extends PriorityQueueNode>iterator in interface Collection<T extends PriorityQueueNode>iterator in class AbstractCollection<T extends PriorityQueueNode>Copyright © 2008–2025 The Netty Project. All rights reserved.