public class SizeBlockingQueue<E>
extends java.util.AbstractQueue<E>
implements java.util.concurrent.BlockingQueue<E>
Constructor and Description |
---|
SizeBlockingQueue(java.util.concurrent.BlockingQueue<E> queue,
int capacity) |
Modifier and Type | Method and Description |
---|---|
int |
capacity() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
int |
drainTo(java.util.Collection<? super E> c) |
int |
drainTo(java.util.Collection<? super E> c,
int maxElements) |
void |
forcePut(E e)
Forces adding an element to the queue, without doing size checks.
|
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() |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public SizeBlockingQueue(java.util.concurrent.BlockingQueue<E> queue, int capacity)
public int size()
public int capacity()
public java.util.Iterator<E> iterator()
public E poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
poll
in interface java.util.concurrent.BlockingQueue<E>
java.lang.InterruptedException
public boolean remove(java.lang.Object o)
public void forcePut(E e) throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean offer(E e)
public 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.InterruptedException
public void put(E e) throws java.lang.InterruptedException
put
in interface java.util.concurrent.BlockingQueue<E>
java.lang.InterruptedException
public E take() throws java.lang.InterruptedException
take
in interface java.util.concurrent.BlockingQueue<E>
java.lang.InterruptedException
public int remainingCapacity()
remainingCapacity
in interface java.util.concurrent.BlockingQueue<E>
public int drainTo(java.util.Collection<? super E> c)
drainTo
in interface java.util.concurrent.BlockingQueue<E>
public int drainTo(java.util.Collection<? super E> c, int maxElements)
drainTo
in interface java.util.concurrent.BlockingQueue<E>
public java.lang.Object[] toArray()
public <T> T[] toArray(T[] a)
public boolean contains(java.lang.Object o)