Example usage for Java java.util.concurrent LinkedBlockingQueue fields, constructors, methods, implement or subclass
The text is from its open source code.
LinkedBlockingQueue() Creates a LinkedBlockingQueue with a capacity of Integer#MAX_VALUE . | |
LinkedBlockingQueue(int capacity) Creates a LinkedBlockingQueue with the given (fixed) capacity. | |
LinkedBlockingQueue(Collection extends E> c) Creates a LinkedBlockingQueue with a capacity of Integer#MAX_VALUE , 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 into this queue if it is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing an IllegalStateException if no space is currently available. |
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) |
boolean | isEmpty() Returns true if this collection contains no elements. |
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. |
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 if necessary for space to become available. |
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() |