BlockingDeque (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
boolean
[add](../../../java/util/concurrent/BlockingDeque.html#add-E-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") 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 throwing anIllegalStateException
if no space is currently available.
void
[addFirst](../../../java/util/concurrent/BlockingDeque.html#addFirst-E-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") 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/BlockingDeque.html#addLast-E-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") 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.
boolean
[contains](../../../java/util/concurrent/BlockingDeque.html#contains-java.lang.Object-)([Object](../../../java/lang/Object.html "class in java.lang") o)
Returns true
if this deque contains the specified element.
[E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque")
[element](../../../java/util/concurrent/BlockingDeque.html#element--)()
Retrieves, but does not remove, the head of the queue represented by this deque (in other words, the first element of this deque).
[Iterator](../../../java/util/Iterator.html "interface in java.util")<[E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque")>
[iterator](../../../java/util/concurrent/BlockingDeque.html#iterator--)()
Returns an iterator over the elements in this deque in proper sequence.
boolean
[offer](../../../java/util/concurrent/BlockingDeque.html#offer-E-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") 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/BlockingDeque.html#offer-E-long-java.util.concurrent.TimeUnit-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") 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/BlockingDeque.html#offerFirst-E-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") 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/BlockingDeque.html#offerFirst-E-long-java.util.concurrent.TimeUnit-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") 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/BlockingDeque.html#offerLast-E-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") 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/BlockingDeque.html#offerLast-E-long-java.util.concurrent.TimeUnit-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") 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/BlockingDeque.html "type parameter in BlockingDeque")
[peek](../../../java/util/concurrent/BlockingDeque.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/BlockingDeque.html "type parameter in BlockingDeque")
[poll](../../../java/util/concurrent/BlockingDeque.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/BlockingDeque.html "type parameter in BlockingDeque")
[poll](../../../java/util/concurrent/BlockingDeque.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/BlockingDeque.html "type parameter in BlockingDeque")
[pollFirst](../../../java/util/concurrent/BlockingDeque.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/BlockingDeque.html "type parameter in BlockingDeque")
[pollLast](../../../java/util/concurrent/BlockingDeque.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.
void
[push](../../../java/util/concurrent/BlockingDeque.html#push-E-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") 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/BlockingDeque.html#put-E-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") 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/BlockingDeque.html#putFirst-E-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") e)
Inserts the specified element at the front of this deque, waiting if necessary for space to become available.
void
[putLast](../../../java/util/concurrent/BlockingDeque.html#putLast-E-)([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") e)
Inserts the specified element at the end of this deque, waiting if necessary for space to become available.
[E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque")
[remove](../../../java/util/concurrent/BlockingDeque.html#remove--)()
Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque).
boolean
[remove](../../../java/util/concurrent/BlockingDeque.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.
boolean
[removeFirstOccurrence](../../../java/util/concurrent/BlockingDeque.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.
boolean
[removeLastOccurrence](../../../java/util/concurrent/BlockingDeque.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/BlockingDeque.html#size--)()
Returns the number of elements in this deque.
[E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque")
[take](../../../java/util/concurrent/BlockingDeque.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/BlockingDeque.html "type parameter in BlockingDeque")
[takeFirst](../../../java/util/concurrent/BlockingDeque.html#takeFirst--)()
Retrieves and removes the first element of this deque, waiting if necessary until an element becomes available.
[E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque")
[takeLast](../../../java/util/concurrent/BlockingDeque.html#takeLast--)()
Retrieves and removes the last element of this deque, waiting if necessary until an element becomes available.