@InterfaceAudience.Private @InterfaceStability.Stable public class BoundedPriorityBlockingQueue<E> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingQueue<E>
| Constructor and Description |
|---|
BoundedPriorityBlockingQueue(int capacity,
java.util.Comparator<? super E> comparator)
Creates a PriorityQueue with the specified capacity that orders its
elements according to the specified comparator.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Comparator<? super E> |
comparator() |
boolean |
contains(java.lang.Object o) |
int |
drainTo(java.util.Collection<? super E> c) |
int |
drainTo(java.util.Collection<? super E> c,
int maxElements) |
java.util.Iterator<E> |
iterator() |
boolean |
offer(E e) |
boolean |
offer(E e,
long timeout,
java.util.concurrent.TimeUnit unit) |
E |
peek() |
E |
poll() |
E |
poll(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
put(E e) |
int |
remainingCapacity() |
boolean |
remove(java.lang.Object o) |
int |
size() |
E |
take() |
containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic BoundedPriorityBlockingQueue(int capacity,
java.util.Comparator<? super E> comparator)
capacity - the capacity of this queuecomparator - the comparator that will be used to order this priority queuepublic boolean offer(E e)
public void put(E e) throws java.lang.InterruptedException
put in interface java.util.concurrent.BlockingQueue<E>java.lang.InterruptedExceptionpublic boolean offer(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
offer in interface java.util.concurrent.BlockingQueue<E>java.lang.InterruptedExceptionpublic E take() throws java.lang.InterruptedException
take in interface java.util.concurrent.BlockingQueue<E>java.lang.InterruptedExceptionpublic E poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
poll in interface java.util.concurrent.BlockingQueue<E>java.lang.InterruptedExceptionpublic int size()
public java.util.Iterator<E> iterator()
public java.util.Comparator<? super E> comparator()
public int remainingCapacity()
remainingCapacity in interface java.util.concurrent.BlockingQueue<E>public boolean remove(java.lang.Object o)
public boolean contains(java.lang.Object o)
public int drainTo(java.util.Collection<? super E> c)
drainTo in interface java.util.concurrent.BlockingQueue<E>