BlockingDeque (Java Platform SE 7 ) (original) (raw)
Modifier and Type
Method and Description
boolean
**[add](../../../java/util/concurrent/BlockingDeque.html#add%28E%29)**([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, returning
true
upon success and throwing an
IllegalStateException
if no space is currently available.
void
**[addFirst](../../../java/util/concurrent/BlockingDeque.html#addFirst%28E%29)**([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%28E%29)**([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%28java.lang.Object%29)**([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%28%29)**()
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%28%29)**()
Returns an iterator over the elements in this deque in proper sequence.
boolean
**[offer](../../../java/util/concurrent/BlockingDeque.html#offer%28E%29)**([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, returning
true
upon success and
false
if no space is currently available.
boolean
**[offer](../../../java/util/concurrent/BlockingDeque.html#offer%28E,%20long,%20java.util.concurrent.TimeUnit%29)**([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%28E%29)**([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%28E,%20long,%20java.util.concurrent.TimeUnit%29)**([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%28E%29)**([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%28E,%20long,%20java.util.concurrent.TimeUnit%29)**([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%28%29)**()
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%28%29)**()
Retrieves and removes 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%28long,%20java.util.concurrent.TimeUnit%29)**(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%28long,%20java.util.concurrent.TimeUnit%29)**(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%28long,%20java.util.concurrent.TimeUnit%29)**(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%28E%29)**([E](../../../java/util/concurrent/BlockingDeque.html "type parameter in BlockingDeque") e)
Pushes an element onto the stack represented by this deque.
void
**[put](../../../java/util/concurrent/BlockingDeque.html#put%28E%29)**([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%28E%29)**([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%28E%29)**([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%28%29)**()
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%28java.lang.Object%29)**([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%28java.lang.Object%29)**([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%28java.lang.Object%29)**([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%28%29)**()
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%28%29)**()
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%28%29)**()
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%28%29)**()
Retrieves and removes the last element of this deque, waiting if necessary until an element becomes available.