LinkedBlockingQueue
Constructors
Properties
Functions
Adds all of the elements in the specified collection to this queue. Attempts to addAll of a queue to itself result in IllegalArgumentException. Further, the behavior of this operation is undefined if the specified collection is modified while the operation is in progress.
Returns the predecessor of live node p, given a node that was once a live ancestor of p (or head); allows unlinking of p.
Runs action on each element found during a traversal starting at p. If p is null, traversal starts at head.
Returns an iterator over the elements in this queue in proper sequence. The elements will be returned in order from first (head) to last (tail).
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. When using a capacity-restricted queue, this method is generally preferable to method add, which can fail to insert an element only by throwing an exception.
Inserts the specified element at the tail of this queue, waiting if necessary up to the specified wait time for space to become available.
Retrieves and removes the head of this queue, or returns null if this queue is empty.
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
Returns the number of additional elements that this queue can ideally (in the absence of memory or resource constraints) accept without blocking. This is always equal to the initial capacity of this queue less the current size of this queue.
Retrieves and removes the head of this queue. This method differs from .poll only in that it throws an exception if this queue is empty.
Removes a single instance of the specified element from this queue, if it is present. More formally, removes an element e such that o.equals(e), if this queue contains one or more such elements. Returns true if this queue contained the specified element (or equivalently, if this queue changed as a result of the call).
Returns a Spliterator over the elements in this queue.
Used for any element traversal that is not entirely under lock. Such traversals must handle both:
Unlinks interior Node p with predecessor pred.