Example usage for Java java.util.concurrent ArrayBlockingQueue fields, constructors, methods, implement or subclass
The text is from its open source code.
ArrayBlockingQueue(int capacity) Creates an ArrayBlockingQueue with the given (fixed) capacity and default access policy. | |
ArrayBlockingQueue(int capacity, boolean fair) Creates an ArrayBlockingQueue with the given (fixed) capacity and the specified access policy. | |
ArrayBlockingQueue(int capacity, boolean fair, Collection extends E> c) Creates an ArrayBlockingQueue with the given (fixed) capacity, the specified access policy and initially containing the elements of the given collection, added in traversal order of the collection's iterator. |
boolean | add(E e) Inserts the specified element at the tail of this queue if it is possible to do so immediately without exceeding the queue's capacity, returning true upon success and throwing an IllegalStateException if this queue is full. |
boolean | addAll(Collection extends E> c) Adds all of the elements in the specified collection to this collection (optional operation). |
void | clear() Atomically removes all of the elements from this queue. |
boolean | contains(Object o) Returns true if this queue contains the specified element. |
int | drainTo(Collection super E> c, int maxElements) |
int | drainTo(Collection super E> c) |
boolean | isEmpty() Returns true if this collection contains no elements. |
Iterator | iterator() Returns an iterator over the elements in this queue in proper sequence. |
boolean | offer(E e) Inserts the specified element at the tail of this queue if it is possible to do so immediately without exceeding the queue's capacity, returning true upon success and false if this queue is full. |
boolean | offer(E e, long timeout, TimeUnit unit) Inserts the specified element at the tail of this queue, waiting up to the specified wait time for space to become available if the queue is full. |
E | peek() |
E | poll() |
E | poll(long timeout, TimeUnit unit) |
void | put(E e) Inserts the specified element at the tail of this queue, waiting for space to become available if the queue is full. |
int | remainingCapacity() Returns the number of additional elements that this queue can ideally (in the absence of memory or resource constraints) accept without blocking. |
boolean | remove(Object o) Removes a single instance of the specified element from this queue, if it is present. |
int | size() Returns the number of elements in this queue. |
E | take() |
Object[] | toArray() Returns an array containing all of the elements in this queue, in proper sequence. |
T[] | toArray(T[] a) Returns an array containing all of the elements in this queue, in proper sequence; the runtime type of the returned array is that of the specified array. |
String | toString() |