public class BoundedPriorityBlockingQueue<E> extends PriorityBlockingQueue<E>
| Constructor and Description |
|---|
BoundedPriorityBlockingQueue(int capacity) |
BoundedPriorityBlockingQueue(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, 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 in interface BlockingQueue<E>offer in interface Queue<E>offer in class PriorityBlockingQueue<E>e - 元素public boolean addAll(E[] c)
AbstractQueue.addAll(java.util.Collection<? extends E>)c - 元素数组Copyright © 2025. All rights reserved.