--- jsr166/src/main/java/util/PriorityQueue.java 2003/08/30 11:44:53 1.37 +++ jsr166/src/main/java/util/PriorityQueue.java 2003/09/12 15:38:26 1.40 @@ -1,4 +1,11 @@ - package java.util; +/* + * %W% %E% + * + * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + */ + +package java.util; /** * An unbounded priority {@linkplain Queue queue} based on a priority heap. @@ -7,10 +14,11 @@ * and {@link java.util.TreeMap}: elements are ordered either according to * their natural order (see {@link Comparable}), or according to a * {@link java.util.Comparator}, depending on which constructor is used. + * *
The head of this queue is the least element with * respect to the specified ordering. If multiple elements are tied for least * value, the head is one of those elements. A priority queue does not permit - * null elements. + * null elements. * *
The {@link #remove()} and {@link #poll()} methods remove and * return the head of the queue. @@ -18,12 +26,12 @@ *
The {@link #element()} and {@link #peek()} methods return, but do * not delete, the head of the queue. * - *
A priority queue has a capacity. The capacity is the - * size of the array used internally to store the elements on the - * queue. - * It is always at least as large as the queue size. As - * elements are added to a priority queue, its capacity grows - * automatically. The details of the growth policy are not specified. + *
A priority queue is unbounded, but has a capacity. The + * capacity is the size of the array used internally to store the + * elements on the queue. It is always at least as large as the queue + * size. As elements are added to a priority queue, its capacity + * grows automatically. The details of the growth policy are not + * specified. * *
The Iterator provided in method {@link #iterator()} is not
* guaranteed to traverse the elements of the PriorityQueue in any
@@ -48,6 +56,7 @@
*
* Java Collections Framework.
* @since 1.5
+ * @version %I%, %G%
* @author Josh Bloch
*/
public class PriorityQueue
* This implementation iterates over the specified collection, and adds
* each object returned by the iterator to this collection, in turn.
- * @throws NullPointerException {@inheritDoc}
+ * @param c collection whose elements are to be added to this queue
+ * @return true if this queue changed as a result of the
+ * call.
+ * @throws NullPointerException if c or any element in c
+ * is null
* @throws ClassCastException if any element cannot be compared
* with elements currently in the priority queue according
* to the priority queue's ordering.
@@ -340,21 +347,6 @@ public class PriorityQueue This implementation iterates over the queue looking for the
- * specified element. If it finds the element, it removes the element
- * from the queue using the iterator's remove method.
- *
- */
public boolean remove(Object o) {
if (o == null)
return false;
@@ -498,12 +490,9 @@ public class PriorityQueue