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