LinkedBlockingDeque (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
boolean
[add](../../../java/util/concurrent/LinkedBlockingDeque.html#add-E-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e)
Inserts the specified element at the end of this deque unless it would violate capacity restrictions.
void
[addFirst](../../../java/util/concurrent/LinkedBlockingDeque.html#addFirst-E-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e)
Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions, throwing an IllegalStateException
if no space is currently available.
void
[addLast](../../../java/util/concurrent/LinkedBlockingDeque.html#addLast-E-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e)
Inserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions, throwing an IllegalStateException
if no space is currently available.
void
[clear](../../../java/util/concurrent/LinkedBlockingDeque.html#clear--)()
Atomically removes all of the elements from this deque.
boolean
[contains](../../../java/util/concurrent/LinkedBlockingDeque.html#contains-java.lang.Object-)([Object](../../../java/lang/Object.html "class in java.lang") o)
Returns true
if this deque contains the specified element.
[Iterator](../../../java/util/Iterator.html "interface in java.util")<[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")>
[descendingIterator](../../../java/util/concurrent/LinkedBlockingDeque.html#descendingIterator--)()
Returns an iterator over the elements in this deque in reverse sequential order.
int
[drainTo](../../../java/util/concurrent/LinkedBlockingDeque.html#drainTo-java.util.Collection-)([Collection](../../../java/util/Collection.html "interface in java.util")<? super [E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")> c)
Removes all available elements from this queue and adds them to the given collection.
int
[drainTo](../../../java/util/concurrent/LinkedBlockingDeque.html#drainTo-java.util.Collection-int-)([Collection](../../../java/util/Collection.html "interface in java.util")<? super [E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")> c, int maxElements)
Removes at most the given number of available elements from this queue and adds them to the given collection.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[element](../../../java/util/concurrent/LinkedBlockingDeque.html#element--)()
Retrieves, but does not remove, the head of the queue represented by this deque.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[getFirst](../../../java/util/concurrent/LinkedBlockingDeque.html#getFirst--)()
Retrieves, but does not remove, the first element of this deque.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[getLast](../../../java/util/concurrent/LinkedBlockingDeque.html#getLast--)()
Retrieves, but does not remove, the last element of this deque.
[Iterator](../../../java/util/Iterator.html "interface in java.util")<[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")>
[iterator](../../../java/util/concurrent/LinkedBlockingDeque.html#iterator--)()
Returns an iterator over the elements in this deque in proper sequence.
boolean
[offer](../../../java/util/concurrent/LinkedBlockingDeque.html#offer-E-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e)
Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque) if it is possible to do so immediately without violating capacity restrictions, returningtrue
upon success and false
if no space is currently available.
boolean
[offer](../../../java/util/concurrent/LinkedBlockingDeque.html#offer-E-long-java.util.concurrent.TimeUnit-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e, long timeout,[TimeUnit](../../../java/util/concurrent/TimeUnit.html "enum in java.util.concurrent") unit)
Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque), waiting up to the specified wait time if necessary for space to become available.
boolean
[offerFirst](../../../java/util/concurrent/LinkedBlockingDeque.html#offerFirst-E-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e)
Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions, returning true
upon success and false
if no space is currently available.
boolean
[offerFirst](../../../java/util/concurrent/LinkedBlockingDeque.html#offerFirst-E-long-java.util.concurrent.TimeUnit-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e, long timeout,[TimeUnit](../../../java/util/concurrent/TimeUnit.html "enum in java.util.concurrent") unit)
Inserts the specified element at the front of this deque, waiting up to the specified wait time if necessary for space to become available.
boolean
[offerLast](../../../java/util/concurrent/LinkedBlockingDeque.html#offerLast-E-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e)
Inserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions, returning true
upon success and false
if no space is currently available.
boolean
[offerLast](../../../java/util/concurrent/LinkedBlockingDeque.html#offerLast-E-long-java.util.concurrent.TimeUnit-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e, long timeout,[TimeUnit](../../../java/util/concurrent/TimeUnit.html "enum in java.util.concurrent") unit)
Inserts the specified element at the end of this deque, waiting up to the specified wait time if necessary for space to become available.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[peek](../../../java/util/concurrent/LinkedBlockingDeque.html#peek--)()
Retrieves, but does not remove, the head of the queue represented by this deque (in other words, the first element of this deque), or returns null
if this deque is empty.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[peekFirst](../../../java/util/concurrent/LinkedBlockingDeque.html#peekFirst--)()
Retrieves, but does not remove, the first element of this deque, or returns null
if this deque is empty.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[peekLast](../../../java/util/concurrent/LinkedBlockingDeque.html#peekLast--)()
Retrieves, but does not remove, the last element of this deque, or returns null
if this deque is empty.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[poll](../../../java/util/concurrent/LinkedBlockingDeque.html#poll--)()
Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), or returnsnull
if this deque is empty.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[poll](../../../java/util/concurrent/LinkedBlockingDeque.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 the queue represented by this deque (in other words, the first element of this deque), waiting up to the specified wait time if necessary for an element to become available.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[pollFirst](../../../java/util/concurrent/LinkedBlockingDeque.html#pollFirst--)()
Retrieves and removes the first element of this deque, or returns null
if this deque is empty.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[pollFirst](../../../java/util/concurrent/LinkedBlockingDeque.html#pollFirst-long-java.util.concurrent.TimeUnit-)(long timeout,[TimeUnit](../../../java/util/concurrent/TimeUnit.html "enum in java.util.concurrent") unit)
Retrieves and removes the first element of this deque, waiting up to the specified wait time if necessary for an element to become available.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[pollLast](../../../java/util/concurrent/LinkedBlockingDeque.html#pollLast--)()
Retrieves and removes the last element of this deque, or returns null
if this deque is empty.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[pollLast](../../../java/util/concurrent/LinkedBlockingDeque.html#pollLast-long-java.util.concurrent.TimeUnit-)(long timeout,[TimeUnit](../../../java/util/concurrent/TimeUnit.html "enum in java.util.concurrent") unit)
Retrieves and removes the last element of this deque, waiting up to the specified wait time if necessary for an element to become available.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[pop](../../../java/util/concurrent/LinkedBlockingDeque.html#pop--)()
Pops an element from the stack represented by this deque.
void
[push](../../../java/util/concurrent/LinkedBlockingDeque.html#push-E-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e)
Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it is possible to do so immediately without violating capacity restrictions, throwing anIllegalStateException
if no space is currently available.
void
[put](../../../java/util/concurrent/LinkedBlockingDeque.html#put-E-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e)
Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque), waiting if necessary for space to become available.
void
[putFirst](../../../java/util/concurrent/LinkedBlockingDeque.html#putFirst-E-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e)
Inserts the specified element at the front of this deque, waiting if necessary for space to become available.
void
[putLast](../../../java/util/concurrent/LinkedBlockingDeque.html#putLast-E-)([E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque") e)
Inserts the specified element at the end of this deque, waiting if necessary for space to become available.
int
[remainingCapacity](../../../java/util/concurrent/LinkedBlockingDeque.html#remainingCapacity--)()
Returns the number of additional elements that this deque can ideally (in the absence of memory or resource constraints) accept without blocking.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[remove](../../../java/util/concurrent/LinkedBlockingDeque.html#remove--)()
Retrieves and removes the head of the queue represented by this deque.
boolean
[remove](../../../java/util/concurrent/LinkedBlockingDeque.html#remove-java.lang.Object-)([Object](../../../java/lang/Object.html "class in java.lang") o)
Removes the first occurrence of the specified element from this deque.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[removeFirst](../../../java/util/concurrent/LinkedBlockingDeque.html#removeFirst--)()
Retrieves and removes the first element of this deque.
boolean
[removeFirstOccurrence](../../../java/util/concurrent/LinkedBlockingDeque.html#removeFirstOccurrence-java.lang.Object-)([Object](../../../java/lang/Object.html "class in java.lang") o)
Removes the first occurrence of the specified element from this deque.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[removeLast](../../../java/util/concurrent/LinkedBlockingDeque.html#removeLast--)()
Retrieves and removes the last element of this deque.
boolean
[removeLastOccurrence](../../../java/util/concurrent/LinkedBlockingDeque.html#removeLastOccurrence-java.lang.Object-)([Object](../../../java/lang/Object.html "class in java.lang") o)
Removes the last occurrence of the specified element from this deque.
int
[size](../../../java/util/concurrent/LinkedBlockingDeque.html#size--)()
Returns the number of elements in this deque.
[Spliterator](../../../java/util/Spliterator.html "interface in java.util")<[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")>
[spliterator](../../../java/util/concurrent/LinkedBlockingDeque.html#spliterator--)()
Returns a Spliterator over the elements in this deque.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[take](../../../java/util/concurrent/LinkedBlockingDeque.html#take--)()
Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), waiting if necessary until an element becomes available.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[takeFirst](../../../java/util/concurrent/LinkedBlockingDeque.html#takeFirst--)()
Retrieves and removes the first element of this deque, waiting if necessary until an element becomes available.
[E](../../../java/util/concurrent/LinkedBlockingDeque.html "type parameter in LinkedBlockingDeque")
[takeLast](../../../java/util/concurrent/LinkedBlockingDeque.html#takeLast--)()
Retrieves and removes the last element of this deque, waiting if necessary until an element becomes available.
[Object](../../../java/lang/Object.html "class in java.lang")[]
[toArray](../../../java/util/concurrent/LinkedBlockingDeque.html#toArray--)()
Returns an array containing all of the elements in this deque, in proper sequence (from first to last element).
<T> T[]
[toArray](../../../java/util/concurrent/LinkedBlockingDeque.html#toArray-T:A-)(T[] a)
Returns an array containing all of the elements in this deque, 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/LinkedBlockingDeque.html#toString--)()
Returns a string representation of this collection.