public class BoundedPriorityBlockingQueue<E> extends PriorityBlockingQueue<E>
| 构造器和说明 |
|---|
BoundedPriorityBlockingQueue(int capacity) |
BoundedPriorityBlockingQueue(int capacity,
Comparator<? super E> comparator)
构造
|
| 限定符和类型 | 方法和说明 |
|---|---|
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, drainTo, drainTo, offer, peek, poll, poll, put, remainingCapacity, remove, size, spliterator, take, toArray, toArray, toStringaddAll, element, removecontainsAll, isEmpty, removeAll, retainAllclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAll, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, streampublic BoundedPriorityBlockingQueue(int capacity)
public BoundedPriorityBlockingQueue(int capacity,
Comparator<? super E> comparator)
capacity - 容量comparator - 比较器public boolean offer(E e)
offer 在接口中 BlockingQueue<E>offer 在接口中 Queue<E>offer 在类中 PriorityBlockingQueue<E>e - 元素public boolean addAll(E[] c)
AbstractQueue.addAll(java.util.Collection<? extends E>)c - 元素数组Copyright © 2024. All rights reserved.