@InterfaceAudience.Private @InterfaceStability.Stable public class BoundedPriorityBlockingQueue<E> extends AbstractQueue<E> implements BlockingQueue<E>
| 构造器和说明 |
|---|
BoundedPriorityBlockingQueue(int capacity,
Comparator<? super E> comparator)
Creates a PriorityQueue with the specified capacity that orders its
elements according to the specified comparator.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Comparator<? super E> |
comparator() |
boolean |
contains(Object o) |
int |
drainTo(Collection<? super E> c) |
int |
drainTo(Collection<? super E> c,
int maxElements) |
Iterator<E> |
iterator() |
boolean |
offer(E e) |
boolean |
offer(E e,
long timeout,
TimeUnit unit) |
E |
peek() |
E |
poll() |
E |
poll(long timeout,
TimeUnit unit) |
void |
put(E e) |
int |
remainingCapacity() |
boolean |
remove(Object o) |
int |
size() |
E |
take() |
containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddaddAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArraypublic BoundedPriorityBlockingQueue(int capacity,
Comparator<? super E> comparator)
capacity - the capacity of this queuecomparator - the comparator that will be used to order this priority queuepublic void put(E e) throws InterruptedException
put 在接口中 BlockingQueue<E>InterruptedExceptionpublic boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException
offer 在接口中 BlockingQueue<E>InterruptedExceptionpublic E take() throws InterruptedException
take 在接口中 BlockingQueue<E>InterruptedExceptionpublic E poll(long timeout, TimeUnit unit) throws InterruptedException
poll 在接口中 BlockingQueue<E>InterruptedExceptionpublic int size()
size 在接口中 Collection<E>size 在类中 AbstractCollection<E>public Iterator<E> iterator()
iterator 在接口中 Iterable<E>iterator 在接口中 Collection<E>iterator 在类中 AbstractCollection<E>public Comparator<? super E> comparator()
public int remainingCapacity()
remainingCapacity 在接口中 BlockingQueue<E>public boolean remove(Object o)
remove 在接口中 Collection<E>remove 在接口中 BlockingQueue<E>remove 在类中 AbstractCollection<E>public boolean contains(Object o)
contains 在接口中 Collection<E>contains 在接口中 BlockingQueue<E>contains 在类中 AbstractCollection<E>public int drainTo(Collection<? super E> c)
drainTo 在接口中 BlockingQueue<E>public int drainTo(Collection<? super E> c, int maxElements)
drainTo 在接口中 BlockingQueue<E>Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.