--- jsr166/src/main/java/util/Deque.java 2005/03/22 16:48:32 1.4 +++ jsr166/src/main/java/util/Deque.java 2005/04/29 02:00:39 1.5 @@ -25,9 +25,9 @@ package java.util; * operations cannot fail. * *

The twelve methods described above are summarized in the - * following table:

+ * following table: * - * + *

* * * @@ -67,64 +67,62 @@ package java.util; * used as a queue, FIFO (First-In-First-Out) behavior results. Elements are * added at the end of the deque and removed from the beginning. The methods * inherited from the Queue interface are precisely equivalent to - * Deque methods as indicated in the following table:

+ * Deque methods as indicated in the following table: * - *

First Element (Head)
+ *

* * * * * - * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * + * *
Queue Method Equivalent Deque Method
{@link java.util.Queue#offer offer(e)}{@link #offerLast offerLast(e)}
{@link java.util.Queue#add add(e)}{@link #addLast addLast(e)}
{@link java.util.Queue#poll poll()}{@link #pollFirst pollFirst()}
{@link java.util.Queue#remove remove()}{@link #removeFirst removeFirst()}
{@link java.util.Queue#peek peek()}{@link #peek peekFirst()}
{@link java.util.Queue#element element()}{@link #getFirst getFirst()}
* *

Deques can also be used as LIFO (Last-In-First-Out) stacks. This * interface should be used in preference to the legacy {@link Stack} class. * When a deque is used as a stack, elements are pushed and popped from the * beginning of the deque. Stack methods are precisely equivalent to - * Deque methods as indicated in the table below:

+ * Deque methods as indicated in the table below: * - * + *

* * * * * - * * * - * - * + * + * * * - * - * + * + * * * - * + * *
Stack Method Equivalent Deque Method
{@link #push push(e)}{@link #addFirst addFirst(e)}
{@link #pop pop()}{@link #removeFirst removeFirst()}
{@link #peek peek()}{@link #peekFirst peekFirst()}
* *

Note that the {@link #peek peek} method works equally well when @@ -232,7 +230,7 @@ public interface Deque extends Queue< E pollLast(); /** - * Removes and returns the first element of this deque. This method + * Retrieves and removes the first element of this deque. This method * differs from the pollFirst method only in that it throws an * exception if this deque is empty. *