--- jsr166/src/main/java/util/Deque.java 2004/12/28 12:14:07 1.1 +++ jsr166/src/main/java/util/Deque.java 2005/03/22 16:48:32 1.4 @@ -24,9 +24,9 @@ package java.util; * Deque implementations; in most implementations, insert * operations cannot fail. * - *

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

- * + *

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

+ * * * * @@ -65,7 +65,7 @@ package java.util; * *

This interface extends the {@link Queue} interface. When a deque is * used as a queue, FIFO (First-In-First-Out) behavior results. Elements are - * added to the end of the deque and removed from the beginning. The methods + * 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:

* @@ -103,7 +103,7 @@ package java.util; * *

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 dequeue is used as a stack, elements are pushed and popped from the + * 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:

* @@ -131,7 +131,7 @@ package java.util; * a deque is used as a queue or a stack; in either case, elements are * drawn from the beginning of the deque. * - *

This inteface provides two methods to to remove interior + *

This interface provides two methods to remove interior * elements, {@link #removeFirstOccurrence removeFirstOccurrence} and * {@link #removeLastOccurrence removeLastOccurrence}. Unlike the * {@link List} interface, this interface does not provide support for @@ -144,7 +144,7 @@ package java.util; * take advantage of the ability to insert nulls. This is so because * null is used as a special return value by various methods * to indicated that the deque is empty. - * + * *

Deque implementations generally do not define * element-based versions of the equals and hashCode * methods, but instead inherit the identity-based versions from class @@ -162,7 +162,7 @@ package java.util; public interface Deque extends Queue { /** - * Inserts the specified element to the front this deque unless it would + * Inserts the specified element at the front of this deque unless it would * violate capacity restrictions. When using a capacity-restricted deque, * this method is generally preferable to method addFirst, which * can fail to insert an element only by throwing an exception. @@ -170,13 +170,13 @@ public interface Deque extends Queue< * @param e the element to insert * @return true if it was possible to insert the element, * else false - * @throws NullPointerException if e is null and this + * @throws NullPointerException if the specified element is null and this * deque does not permit null elements */ boolean offerFirst(E e); /** - * Inserts the specified element to the end of this deque unless it would + * Inserts the specified element at the end of this deque unless it would * violate capacity restrictions. When using a capacity-restricted deque, * this method is generally preferable to method addLast which * can fail to insert an element only by throwing an exception. @@ -184,31 +184,31 @@ public interface Deque extends Queue< * @param e the element to insert * @return true if it was possible to insert the element, * else false - * @throws NullPointerException if e is null and this + * @throws NullPointerException if the specified element is null and this * deque does not permit null elements */ boolean offerLast(E e); /** - * Inserts the specified element to the front of this deque unless it + * Inserts the specified element at the front of this deque unless it * would violate capacity restrictions. * * @param e the element to insert * @throws IllegalStateException if it was not possible to insert * the element due to capacity restrictions - * @throws NullPointerException if e is null and this + * @throws NullPointerException if the specified element is null and this * deque does not permit null elements */ void addFirst(E e); /** - * Inserts the specified element to the end of this deque unless it would + * Inserts the specified element at the end of this deque unless it would * violate capacity restrictions. * * @param e the element to insert * @throws IllegalStateException if it was not possible to insert * the element due to capacity restrictions - * @throws NullPointerException if e is null and this + * @throws NullPointerException if the specified element is null and this * deque does not permit null elements */ void addLast(E e); @@ -271,7 +271,7 @@ public interface Deque extends Queue< /** * Retrieves, but does not remove, the first element of this - * deque. This method differs from the peek method only + * deque. This method differs from the peekFirst method only * in that it throws an exception if this deque is empty. * * @return the first element of this deque @@ -281,7 +281,7 @@ public interface Deque extends Queue< /** * Retrieves, but does not remove, the last element of this - * deque. This method differs from the peek method only + * deque. This method differs from the peekLast method only * in that it throws an exception if this deque is empty. * * @return the last element of this deque @@ -296,11 +296,12 @@ public interface Deque extends Queue< * such that (o==null ? e==null : o.equals(e)) (if * such an element exists). * - * @param e element to be removed from this deque, if present + * @param o element to be removed from this deque, if present * @return true if the deque contained the specified element - * @throws NullPointerException if the specified element is null + * @throws NullPointerException if the specified element is null and this + * deque does not permit null elements */ - boolean removeFirstOccurrence(Object e); + boolean removeFirstOccurrence(Object o); /** * Removes the last occurrence of the specified element in this @@ -309,11 +310,12 @@ public interface Deque extends Queue< * such that (o==null ? e==null : o.equals(e)) (if * such an element exists). * - * @param e element to be removed from this deque, if present + * @param o element to be removed from this deque, if present * @return true if the deque contained the specified element - * @throws NullPointerException if the specified element is null + * @throws NullPointerException if the specified element is null and this + * deque does not permit null elements */ - boolean removeLastOccurrence(Object e); + boolean removeLastOccurrence(Object o); // *** Queue methods *** @@ -321,7 +323,7 @@ public interface Deque extends Queue< /** * Inserts the specified element into the queue represented by this deque * unless it would violate capacity restrictions. In other words, inserts - * the specified element to the end of this deque. When using a + * the specified element at the end of this deque. When using a * capacity-restricted deque, this method is generally preferable to the * {@link #add} method, which can fail to insert an element only by * throwing an exception. @@ -331,7 +333,7 @@ public interface Deque extends Queue< * @param e the element to insert * @return true if it was possible to insert the element, * else false - * @throws NullPointerException if e is null and this + * @throws NullPointerException if the specified element is null and this * deque does not permit null elements */ boolean offer(E e); @@ -339,7 +341,7 @@ public interface Deque extends Queue< /** * Inserts the specified element into the queue represented by this * deque unless it would violate capacity restrictions. In other words, - * inserts the specified element as the last element of this deque. + * inserts the specified element as the last element of this deque. * *

This method is equivalent to {@link #addLast}. * @@ -347,7 +349,7 @@ public interface Deque extends Queue< * @return true (as per the spec for {@link Collection#add}) * @throws IllegalStateException if it was not possible to insert * the element due to capacity restrictions - * @throws NullPointerException if e is null and this + * @throws NullPointerException if the specified element is null and this * deque does not permit null elements */ boolean add(E e); @@ -381,7 +383,7 @@ public interface Deque extends Queue< * Retrieves, but does not remove, the head of the queue represented by * this deque, returning null if this deque is empty. * - *

This method is equivalent to {@link #peekFirst()} + *

This method is equivalent to {@link #peekFirst()}. * * @return the head of the queue represented by this deque, or * null if this deque is empty @@ -393,7 +395,7 @@ public interface Deque extends Queue< * this deque. This method differs from the peek method only in * that it throws an exception if this deque is empty. * - *

This method is equivalent to {@link #getFirst()} + *

This method is equivalent to {@link #getFirst()}. * * @return the head of the queue represented by this deque * @throws NoSuchElementException if this deque is empty @@ -405,21 +407,22 @@ public interface Deque extends Queue< /** * Pushes an element onto the stack represented by this deque. In other - * words, inserts the element to the front this deque unless it would + * words, inserts the element at the front of this deque unless it would * violate capacity restrictions. * *

This method is equivalent to {@link #addFirst}. * + * @param e the element to push * @throws IllegalStateException if it was not possible to insert * the element due to capacity restrictions - * @throws NullPointerException if e is null and this + * @throws NullPointerException if the specified element is null and this * deque does not permit null elements */ void push(E e); /** * Pops an element from the stack represented by this deque. In other - * words, removes and returns the the first element of this deque. + * words, removes and returns the first element of this deque. * *

This method is equivalent to {@link #removeFirst()}. * @@ -435,7 +438,7 @@ public interface Deque extends Queue< /** * Returns an iterator over the elements in this deque. The elements * will be ordered from first (head) to last (tail). - * + * * @return an Iterator over the elements in this deque */ Iterator iterator();