public class GrowableMpScArrayConsumerBlockingQueue<T>
extends java.util.AbstractQueue<T>
implements java.util.concurrent.BlockingQueue<T>
BlockingQueue backed by an array with no fixed capacity.
When the capacity is reached, data will be moved to a bigger array.
This queue only allows 1 consumer thread to dequeue items and multiple producer threads.
| Constructor and Description |
|---|
GrowableMpScArrayConsumerBlockingQueue() |
GrowableMpScArrayConsumerBlockingQueue(int initialCapacity) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T e) |
void |
clear() |
int |
drainTo(java.util.Collection<? super T> c) |
int |
drainTo(java.util.Collection<? super T> c,
int maxElements) |
T |
element() |
java.util.Iterator<T> |
iterator() |
boolean |
offer(T e) |
boolean |
offer(T e,
long timeout,
java.util.concurrent.TimeUnit unit) |
T |
peek() |
T |
poll() |
T |
poll(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
put(T e) |
int |
remainingCapacity() |
T |
remove() |
int |
size() |
T |
take() |
java.lang.String |
toString() |
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic GrowableMpScArrayConsumerBlockingQueue()
public GrowableMpScArrayConsumerBlockingQueue(int initialCapacity)
public T remove()
public T element()
public boolean offer(T e)
public boolean add(T e)
public boolean offer(T e, long timeout, java.util.concurrent.TimeUnit unit)
offer in interface java.util.concurrent.BlockingQueue<T>public T take() throws java.lang.InterruptedException
take in interface java.util.concurrent.BlockingQueue<T>java.lang.InterruptedExceptionpublic T poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
poll in interface java.util.concurrent.BlockingQueue<T>java.lang.InterruptedExceptionpublic int remainingCapacity()
remainingCapacity in interface java.util.concurrent.BlockingQueue<T>public int drainTo(java.util.Collection<? super T> c)
drainTo in interface java.util.concurrent.BlockingQueue<T>public int drainTo(java.util.Collection<? super T> c, int maxElements)
drainTo in interface java.util.concurrent.BlockingQueue<T>public void clear()
public int size()
public java.util.Iterator<T> iterator()
public java.lang.String toString()
toString in class java.util.AbstractCollection<T>Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.