T
- The object that is maintained in the queue.public final class DefaultPriorityQueue<T extends PriorityQueueNode> extends java.util.AbstractQueue<T> implements PriorityQueue<T>
PriorityQueueNode
for the purpose of maintaining the index in the priority queue.构造器和说明 |
---|
DefaultPriorityQueue(java.util.Comparator<T> comparator,
int initialSize) |
限定符和类型 | 方法和说明 |
---|---|
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(java.lang.Object o) |
boolean |
containsTyped(T node)
Same as
Collection.contains(Object) but typed using generics. |
boolean |
isEmpty() |
java.util.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(java.lang.Object o) |
boolean |
removeTyped(T node)
Same as
Collection.remove(Object) but typed using generics. |
int |
size() |
java.lang.Object[] |
toArray() |
<X> X[] |
toArray(X[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public DefaultPriorityQueue(java.util.Comparator<T> comparator, int initialSize)
public int size()
size
在接口中 java.util.Collection<T extends PriorityQueueNode>
size
在类中 java.util.AbstractCollection<T extends PriorityQueueNode>
public boolean isEmpty()
isEmpty
在接口中 java.util.Collection<T extends PriorityQueueNode>
isEmpty
在类中 java.util.AbstractCollection<T extends PriorityQueueNode>
public boolean contains(java.lang.Object o)
contains
在接口中 java.util.Collection<T extends PriorityQueueNode>
contains
在类中 java.util.AbstractCollection<T extends PriorityQueueNode>
public boolean containsTyped(T node)
PriorityQueue
Collection.contains(Object)
but typed using generics.containsTyped
在接口中 PriorityQueue<T extends PriorityQueueNode>
public void clear()
clear
在接口中 java.util.Collection<T extends PriorityQueueNode>
clear
在类中 java.util.AbstractQueue<T extends PriorityQueueNode>
public void clearIgnoringIndexes()
PriorityQueue
PriorityQueue
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
在接口中 PriorityQueue<T extends PriorityQueueNode>
public boolean offer(T e)
offer
在接口中 java.util.Queue<T extends PriorityQueueNode>
public T poll()
poll
在接口中 java.util.Queue<T extends PriorityQueueNode>
public T peek()
peek
在接口中 java.util.Queue<T extends PriorityQueueNode>
public boolean remove(java.lang.Object o)
remove
在接口中 java.util.Collection<T extends PriorityQueueNode>
remove
在类中 java.util.AbstractCollection<T extends PriorityQueueNode>
public boolean removeTyped(T node)
PriorityQueue
Collection.remove(Object)
but typed using generics.removeTyped
在接口中 PriorityQueue<T extends PriorityQueueNode>
public void priorityChanged(T node)
PriorityQueue
node
has changed. The queue will adjust to ensure the priority
queue properties are maintained.priorityChanged
在接口中 PriorityQueue<T extends PriorityQueueNode>
node
- An object which is in this queue and the priority may have changed.public java.lang.Object[] toArray()
toArray
在接口中 java.util.Collection<T extends PriorityQueueNode>
toArray
在类中 java.util.AbstractCollection<T extends PriorityQueueNode>
public <X> X[] toArray(X[] a)
toArray
在接口中 java.util.Collection<T extends PriorityQueueNode>
toArray
在类中 java.util.AbstractCollection<T extends PriorityQueueNode>
public java.util.Iterator<T> iterator()
iterator
在接口中 java.lang.Iterable<T extends PriorityQueueNode>
iterator
在接口中 java.util.Collection<T extends PriorityQueueNode>
iterator
在类中 java.util.AbstractCollection<T extends PriorityQueueNode>