public class SizeBlockingQueue<E> extends AbstractQueue<E> implements BlockingQueue<E>
| Constructor and Description |
|---|
SizeBlockingQueue(BlockingQueue<E> queue,
int capacity) |
| Modifier and Type | Method and Description |
|---|---|
int |
capacity() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
int |
drainTo(Collection<? super E> c) |
int |
drainTo(Collection<? super E> c,
int maxElements) |
void |
forcePut(E e)
Forces adding an element to the queue, without doing size checks.
|
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() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
isEmpty, removeAll, retainAll, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddpublic SizeBlockingQueue(BlockingQueue<E> queue, int capacity)
public int size()
size in interface Collection<E>size in class AbstractCollection<E>public int capacity()
public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in class AbstractCollection<E>public E poll(long timeout, TimeUnit unit) throws InterruptedException
poll in interface BlockingQueue<E>InterruptedExceptionpublic boolean remove(Object o)
remove in interface Collection<E>remove in interface BlockingQueue<E>remove in class AbstractCollection<E>public void forcePut(E e) throws InterruptedException
InterruptedExceptionpublic boolean offer(E e)
public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException
offer in interface BlockingQueue<E>InterruptedExceptionpublic void put(E e) throws InterruptedException
put in interface BlockingQueue<E>InterruptedExceptionpublic E take() throws InterruptedException
take in interface BlockingQueue<E>InterruptedExceptionpublic int remainingCapacity()
remainingCapacity in interface BlockingQueue<E>public int drainTo(Collection<? super E> c)
drainTo in interface BlockingQueue<E>public int drainTo(Collection<? super E> c, int maxElements)
drainTo in interface BlockingQueue<E>public Object[] toArray()
toArray in interface Collection<E>toArray in class AbstractCollection<E>public <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in class AbstractCollection<E>public boolean contains(Object o)
contains in interface Collection<E>contains in interface BlockingQueue<E>contains in class AbstractCollection<E>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in class AbstractCollection<E>Copyright © 2009–2016. All rights reserved.