39 |
|
*/ |
40 |
|
public class LinkedBlockingDeque<E> |
41 |
|
extends AbstractQueue<E> |
42 |
< |
implements BlockingDeque<E>, java.io.Serializable { |
42 |
> |
implements BlockingDeque<E>, java.io.Serializable { |
43 |
|
|
44 |
|
/* |
45 |
|
* Implemented as a simple doubly-linked list protected by a |
434 |
|
|
435 |
|
// BlockingQueue methods |
436 |
|
|
437 |
< |
public void put(E o) throws InterruptedException { putLast(o); } |
438 |
< |
public E take() throws InterruptedException { return takeFirst(); } |
437 |
> |
public void put(E o) throws InterruptedException { putLast(o); } |
438 |
> |
public E take() throws InterruptedException { return takeFirst(); } |
439 |
|
public boolean offer(E o, long timeout, TimeUnit unit) |
440 |
|
throws InterruptedException { return offerLast(o, timeout, unit); } |
441 |
|
public E poll(long timeout, TimeUnit unit) |
524 |
|
* Variant of removeFirstOccurrence needed by iterator.remove. |
525 |
|
* Searches for the node, not its contents. |
526 |
|
*/ |
527 |
< |
boolean removeNode(Node<E> e) { |
527 |
> |
boolean removeNode(Node<E> e) { |
528 |
|
lock.lock(); |
529 |
|
try { |
530 |
|
for (Node<E> p = first; p != null; p = p.next) { |
717 |
|
} |
718 |
|
|
719 |
|
/** |
720 |
< |
* Save the state to a stream (that is, serialize it). |
720 |
> |
* Saves the state to a stream (that is, serializes it). |
721 |
|
* |
722 |
|
* @serialData The capacity (int), followed by elements (each an |
723 |
|
* <tt>Object</tt>) in the proper order, followed by a null |
740 |
|
} |
741 |
|
|
742 |
|
/** |
743 |
< |
* Reconstitute this deque instance from a stream (that is, |
744 |
< |
* deserialize it). |
743 |
> |
* Reconstitutes this deque instance from a stream (that is, |
744 |
> |
* deserializes it). |
745 |
|
* @param s the stream |
746 |
|
*/ |
747 |
|
private void readObject(java.io.ObjectInputStream s) |