LinkedBlockingQueue (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
void
[clear](../../../java/util/concurrent/LinkedBlockingQueue.html#clear--)()
Atomically removes all of the elements from this queue.
boolean
[contains](../../../java/util/concurrent/LinkedBlockingQueue.html#contains-java.lang.Object-)([Object](../../../java/lang/Object.html "class in java.lang") o)
Returns true
if this queue contains the specified element.
int
[drainTo](../../../java/util/concurrent/LinkedBlockingQueue.html#drainTo-java.util.Collection-)([Collection](../../../java/util/Collection.html "interface in java.util")<? super [E](../../../java/util/concurrent/LinkedBlockingQueue.html "type parameter in LinkedBlockingQueue")> c)
Removes all available elements from this queue and adds them to the given collection.
int
[drainTo](../../../java/util/concurrent/LinkedBlockingQueue.html#drainTo-java.util.Collection-int-)([Collection](../../../java/util/Collection.html "interface in java.util")<? super [E](../../../java/util/concurrent/LinkedBlockingQueue.html "type parameter in LinkedBlockingQueue")> c, int maxElements)
Removes at most the given number of available elements from this queue and adds them to the given collection.
[Iterator](../../../java/util/Iterator.html "interface in java.util")<[E](../../../java/util/concurrent/LinkedBlockingQueue.html "type parameter in LinkedBlockingQueue")>
[iterator](../../../java/util/concurrent/LinkedBlockingQueue.html#iterator--)()
Returns an iterator over the elements in this queue in proper sequence.
boolean
[offer](../../../java/util/concurrent/LinkedBlockingQueue.html#offer-E-)([E](../../../java/util/concurrent/LinkedBlockingQueue.html "type parameter in LinkedBlockingQueue") 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](../../../java/util/concurrent/LinkedBlockingQueue.html#offer-E-long-java.util.concurrent.TimeUnit-)([E](../../../java/util/concurrent/LinkedBlockingQueue.html "type parameter in LinkedBlockingQueue") e, long timeout,[TimeUnit](../../../java/util/concurrent/TimeUnit.html "enum in java.util.concurrent") unit)
Inserts the specified element at the tail of this queue, waiting if necessary up to the specified wait time for space to become available.
[E](../../../java/util/concurrent/LinkedBlockingQueue.html "type parameter in LinkedBlockingQueue")
[peek](../../../java/util/concurrent/LinkedBlockingQueue.html#peek--)()
Retrieves, but does not remove, the head of this queue, or returns null
if this queue is empty.
[E](../../../java/util/concurrent/LinkedBlockingQueue.html "type parameter in LinkedBlockingQueue")
[poll](../../../java/util/concurrent/LinkedBlockingQueue.html#poll--)()
Retrieves and removes the head of this queue, or returns null
if this queue is empty.
[E](../../../java/util/concurrent/LinkedBlockingQueue.html "type parameter in LinkedBlockingQueue")
[poll](../../../java/util/concurrent/LinkedBlockingQueue.html#poll-long-java.util.concurrent.TimeUnit-)(long timeout,[TimeUnit](../../../java/util/concurrent/TimeUnit.html "enum in java.util.concurrent") unit)
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
void
[put](../../../java/util/concurrent/LinkedBlockingQueue.html#put-E-)([E](../../../java/util/concurrent/LinkedBlockingQueue.html "type parameter in LinkedBlockingQueue") e)
Inserts the specified element at the tail of this queue, waiting if necessary for space to become available.
int
[remainingCapacity](../../../java/util/concurrent/LinkedBlockingQueue.html#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](../../../java/util/concurrent/LinkedBlockingQueue.html#remove-java.lang.Object-)([Object](../../../java/lang/Object.html "class in java.lang") o)
Removes a single instance of the specified element from this queue, if it is present.
int
[size](../../../java/util/concurrent/LinkedBlockingQueue.html#size--)()
Returns the number of elements in this queue.
[Spliterator](../../../java/util/Spliterator.html "interface in java.util")<[E](../../../java/util/concurrent/LinkedBlockingQueue.html "type parameter in LinkedBlockingQueue")>
[spliterator](../../../java/util/concurrent/LinkedBlockingQueue.html#spliterator--)()
Returns a Spliterator over the elements in this queue.
[E](../../../java/util/concurrent/LinkedBlockingQueue.html "type parameter in LinkedBlockingQueue")
[take](../../../java/util/concurrent/LinkedBlockingQueue.html#take--)()
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.
[Object](../../../java/lang/Object.html "class in java.lang")[]
[toArray](../../../java/util/concurrent/LinkedBlockingQueue.html#toArray--)()
Returns an array containing all of the elements in this queue, in proper sequence.
<T> T[]
[toArray](../../../java/util/concurrent/LinkedBlockingQueue.html#toArray-T:A-)(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](../../../java/lang/String.html "class in java.lang")
[toString](../../../java/util/concurrent/LinkedBlockingQueue.html#toString--)()
Returns a string representation of this collection.