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

Comparing jsr166/src/main/java/util/concurrent/PriorityBlockingQueue.java (file contents):
Revision 1.23 by dl, Sat Sep 13 18:51:11 2003 UTC vs.
Revision 1.24 by dl, Mon Sep 15 12:02:46 2003 UTC

# Line 11 | Line 11 | import java.util.*;
11  
12   /**
13   * An unbounded {@linkplain BlockingQueue blocking queue} based on a
14 < * {@link PriorityQueue},
15 < * obeying its ordering rules and implementation characteristics.
16 < * While this queue is logically unbounded,
17 < * attempted additions may fail due to resource exhaustion (causing
18 < * <tt>OutOfMemoryError</tt>).
14 > * {@link PriorityQueue}, obeying its ordering rules and
15 > * implementation characteristics.  While this queue is logically
16 > * unbounded, attempted additions may fail due to resource exhaustion
17 > * (causing <tt>OutOfMemoryError</tt>). A priority queue does not
18 > * permit <tt>null</tt> elements.  A priority queue relying on natural
19 > * ordering also does not permit insertion of non-comparable objects
20 > * (doing so results in <tt>ClassCastException</tt>).
21   *
22   * <p>This class implements all of the <em>optional</em> methods
23   * of the {@link Collection} and {@link Iterator} interfaces.
# Line 117 | Line 119 | public class PriorityBlockingQueue<E> ex
119      }
120  
121      /**
120     * Adds all of the elements in the specified collection to this queue.
121     * The behavior of this operation is undefined if
122     * the specified collection is modified while the operation is in
123     * progress.  (This implies that the behavior of this call is undefined if
124     * the specified collection is this queue, and this queue is nonempty.)
125     * <p>
126     * This implementation iterates over the specified collection, and adds
127     * each object returned by the iterator to this collection, in turn.
128     * @param c collection whose elements are to be added to this queue
129     * @return <tt>true</tt> if this queue changed as a result of the
130     *         call.
131     * @throws NullPointerException if <tt>c</tt> or any element in <tt>c</tt>
132     * is <tt>null</tt>
133     * @throws ClassCastException if any element cannot be compared
134     * with elements currently in the priority queue according
135     * to the priority queue's ordering.
136     */
137    public boolean addAll(Collection<? extends E> c) {
138        return super.addAll(c);
139    }
140
141    /**
122       * Returns the comparator used to order this collection, or <tt>null</tt>
123       * if this collection is sorted according to its elements natural ordering
124       * (using <tt>Comparable</tt>).
# Line 151 | Line 131 | public class PriorityBlockingQueue<E> ex
131      }
132  
133      /**
134 <     * Inserts the specified element to this priority queue.
134 >     * Inserts the specified element into this priority queue.
135       *
136       * @param o the element to add
137       * @return <tt>true</tt>
# Line 187 | Line 167 | public class PriorityBlockingQueue<E> ex
167      }
168  
169      /**
170 <     * Adds the specified element to this priority queue. As the queue is
170 >     * Inserts the specified element into this priority queue. As the queue is
171       * unbounded this method will never block.
172       * @param o the element to add
173       * @param timeout This parameter is ignored as the method never blocks

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines