public class PriorityQueue<E> extends PriorityQueue<E>
| Constructor and Description |
|---|
PriorityQueue(int capacity) |
PriorityQueue(int capacity,
Comparator<? super E> comparator)
构造
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAll(E[] c)
添加多个元素
参数为集合的情况请使用
addAll(E[]) |
Iterator<E> |
iterator() |
boolean |
offer(E e)
加入元素,当队列满时,淘汰末尾元素
|
ArrayList<E> |
toList() |
add, clear, comparator, contains, peek, poll, remove, size, spliterator, toArray, toArrayaddAll, element, removecontainsAll, isEmpty, removeAll, retainAll, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, streampublic PriorityQueue(int capacity)
public PriorityQueue(int capacity,
Comparator<? super E> comparator)
capacity - 容量comparator - 比较器public boolean offer(E e)
public boolean addAll(E[] c)
addAll(E[])c - 元素数组Copyright © 2020. All rights reserved.