ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/AbstractQueue.java
(Generate patch)

Comparing jsr166/src/main/java/util/AbstractQueue.java (file contents):
Revision 1.25 by dl, Tue Jan 27 11:36:26 2004 UTC vs.
Revision 1.27 by jsr166, Mon May 2 08:35:49 2005 UTC

# Line 28 | Line 28 | package java.util;
28   * <p>This class is a member of the
29   * <a href="{@docRoot}/../guide/collections/index.html">
30   * Java Collections Framework</a>.
31 < *  
31 > *
32   * @since 1.5
33   * @author Doug Lea
34   * @param <E> the type of elements held in this collection
# Line 47 | Line 47 | public abstract class AbstractQueue<E>
47      /**
48       * Adds the specified element to this queue. This implementation
49       * returns <tt>true</tt> if <tt>offer</tt> succeeds, else
50 <     * throws an IllegalStateException.
51 <     *
52 <     * @param o the element
50 >     * throws an IllegalStateException.
51 >     *
52 >     * @param e the element
53       * @return <tt>true</tt> (as per the general contract of
54       *         <tt>Collection.add</tt>).
55       *
56 <     * @throws NullPointerException if the specified element is <tt>null</tt>
57 <     * @throws IllegalStateException if element cannot be added
56 >     * @throws NullPointerException if the specified element is <tt>null</tt>.
57 >     * @throws IllegalStateException if the element cannot be added.
58       */
59 <    public boolean add(E o) {
60 <        if (offer(o))
59 >    public boolean add(E e) {
60 >        if (offer(e))
61              return true;
62          else
63              throw new IllegalStateException("Queue full");
# Line 79 | Line 79 | public abstract class AbstractQueue<E>
79              throw new NoSuchElementException();
80      }
81  
82
82      /**
83 <     * Retrieves, but does not remove, the head of this queue.  
83 >     * Retrieves, but does not remove, the head of this queue.
84       * This implementation returns the result of <tt>peek</tt>
85       * unless the queue is empty.
86       *
# Line 97 | Line 96 | public abstract class AbstractQueue<E>
96      }
97  
98      /**
99 <     * Removes all of the elements from this collection.
100 <     * The collection will be empty after this call returns.
99 >     * Removes all of the elements from this queue.
100 >     * The queue will be empty after this call returns.
101       * <p>This implementation repeatedly invokes {@link #poll poll} until it
102       * returns <tt>null</tt>.
103       */
# Line 116 | Line 115 | public abstract class AbstractQueue<E>
115       *
116       * <p>This implementation iterates over the specified collection,
117       * and adds each element returned by the iterator to this
118 <     * collection, in turn.  A runtime exception encountered while
118 >     * queue, in turn.  A runtime exception encountered while
119       * trying to add an element (including, in particular, a
120       * <tt>null</tt> element) may result in only some of the elements
121       * having been successfully added when the associated exception is
122       * thrown.
123       *
124 <     * @param c collection whose elements are to be added to this collection.
125 <     * @return <tt>true</tt> if this collection changed as a result of the
124 >     * @param c collection whose elements are to be added to this queue.
125 >     * @return <tt>true</tt> if this queue changed as a result of the
126       *         call.
127       * @throws NullPointerException if the specified collection or
128 <     * any of its elements are null.
128 >     *         any of its elements are null.
129       * @throws IllegalArgumentException if c is this queue.
130 <     *
130 >     *
131       * @see #add(Object)
132       */
133      public boolean addAll(Collection<? extends E> c) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines