public class GrowableArrayBlockingQueue<T> extends AbstractQueue<T> implements BlockingQueue<T>
BlockingQueue backed by an array with no fixed capacity.
When the capacity is reached, data will be moved to a bigger array.
| Constructor and Description |
|---|
GrowableArrayBlockingQueue() |
GrowableArrayBlockingQueue(int initialCapacity) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T e) |
void |
clear() |
int |
drainTo(Collection<? super T> c) |
int |
drainTo(Collection<? super T> c,
int maxElements) |
T |
element() |
void |
forEach(Consumer<? super T> action) |
Iterator<T> |
iterator() |
boolean |
offer(T e) |
boolean |
offer(T e,
long timeout,
TimeUnit unit) |
T |
peek() |
T |
poll() |
T |
poll(long timeout,
TimeUnit unit) |
void |
put(T e) |
int |
remainingCapacity() |
T |
remove() |
boolean |
remove(Object o) |
int |
size() |
T |
take() |
List<T> |
toList() |
String |
toString() |
addAllcontains, containsAll, isEmpty, removeAll, retainAll, toArray, toArrayclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontainsaddAll, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArraypublic GrowableArrayBlockingQueue()
public GrowableArrayBlockingQueue(int initialCapacity)
public T remove()
public T element()
public boolean offer(T e)
public void put(T e)
put in interface BlockingQueue<T>public boolean add(T e)
add in interface Collection<T>add in interface BlockingQueue<T>add in interface Queue<T>add in class AbstractQueue<T>public boolean offer(T e, long timeout, TimeUnit unit)
offer in interface BlockingQueue<T>public T take() throws InterruptedException
take in interface BlockingQueue<T>InterruptedExceptionpublic T poll(long timeout, TimeUnit unit) throws InterruptedException
poll in interface BlockingQueue<T>InterruptedExceptionpublic int remainingCapacity()
remainingCapacity in interface BlockingQueue<T>public int drainTo(Collection<? super T> c)
drainTo in interface BlockingQueue<T>public int drainTo(Collection<? super T> c, int maxElements)
drainTo in interface BlockingQueue<T>public void clear()
clear in interface Collection<T>clear in class AbstractQueue<T>public boolean remove(Object o)
remove in interface Collection<T>remove in interface BlockingQueue<T>remove in class AbstractCollection<T>public int size()
size in interface Collection<T>size in class AbstractCollection<T>public Iterator<T> iterator()
iterator in interface Iterable<T>iterator in interface Collection<T>iterator in class AbstractCollection<T>public String toString()
toString in class AbstractCollection<T>Copyright © 2017–2021 Apache Software Foundation. All rights reserved.