--- jsr166/src/main/java/util/Deque.java 2005/05/17 07:29:01 1.10 +++ jsr166/src/main/java/util/Deque.java 2005/06/18 01:56:01 1.14 @@ -5,6 +5,7 @@ */ package java.util; +import java.util.*; // for javadoc /** * A linear collection that supports element insertion and removal at @@ -182,11 +183,13 @@ public interface Deque extends Queue< void addFirst(E e); /** - * Inserts the specified element at the end of this deque if it is + * Inserts the specified element at the end of this deque if it is * possible to do so immediately without violating capacity restrictions. * When using a capacity-restricted deque, it is generally preferable to * use method {@link #offerLast}. * + *

This method is equivalent to {@link #add}. + * * @param e the element to add * @throws IllegalStateException if the element cannot be added at this * time due to capacity restrictions @@ -206,8 +209,8 @@ public interface Deque extends Queue< * which can fail to insert an element only by throwing an exception. * * @param e the element to add - * @return true if it was possible to insert the element, - * else false + * @return true if the element was added to this deque, else + * false * @throws ClassCastException if the class of the specified element * prevents it from being added to this deque * @throws NullPointerException if the specified element is null and this @@ -224,8 +227,8 @@ public interface Deque extends Queue< * which can fail to insert an element only by throwing an exception. * * @param e the element to add - * @return true if it was possible to insert the element, - * else false + * @return true if the element was added to this deque, else + * false * @throws ClassCastException if the class of the specified element * prevents it from being added to this deque * @throws NullPointerException if the specified element is null and this @@ -313,8 +316,8 @@ public interface Deque extends Queue< * More formally, removes the first element e such that * (o==null ? e==null : o.equals(e)) * (if such an element exists). - * Returns true if this deque contained the specified element (or - * equivalently, if this deque changed as a result of the call). + * Returns true if this deque contained the specified element + * (or equivalently, if this deque changed as a result of the call). * * @param o element to be removed from this deque, if present * @return true if an element was removed as a result of this call @@ -331,8 +334,8 @@ public interface Deque extends Queue< * More formally, removes the last element e such that * (o==null ? e==null : o.equals(e)) * (if such an element exists). - * Returns true if this deque contained the specified element (or - * equivalently, if this deque changed as a result of the call). + * Returns true if this deque contained the specified element + * (or equivalently, if this deque changed as a result of the call). * * @param o element to be removed from this deque, if present * @return true if an element was removed as a result of this call @@ -354,7 +357,7 @@ public interface Deque extends Queue< * When using a capacity-restricted deque, it is generally preferable to * use {@link #offer(Object) offer}. * - *

This method is equivalent to {@link #addLast(Object) addLast}. + *

This method is equivalent to {@link #addLast}. * * @param e the element to add * @return true (as per the spec for {@link Collection#add}) @@ -487,8 +490,8 @@ public interface Deque extends Queue< * More formally, removes the first element e such that * (o==null ? e==null : o.equals(e)) * (if such an element exists). - * Returns true if this deque contained the specified element (or - * equivalently, if this deque changed as a result of the call). + * Returns true if this deque contained the specified element + * (or equivalently, if this deque changed as a result of the call). * *

This method is equivalent to {@link #removeFirstOccurrence}. *