--- jsr166/src/main/java/util/PriorityQueue.java 2003/08/13 14:11:59 1.28 +++ jsr166/src/main/java/util/PriorityQueue.java 2003/08/24 23:31:53 1.29 @@ -28,6 +28,18 @@ * 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 + * particular order. If you need ordered traversal, consider using + * Arrays.sort(pq.toArray()). + * + *

Note that this implementation is not synchronized. + * Multiple threads should not access a PriorityQueue + * instance concurrently if any of the threads modifies the list + * structurally. Instead, use the thread-safe {@link + * java.util.concurrent.BlockingPriorityQueue} class. + * + * *

Implementation note: this implementation provides O(log(n)) time * for the insertion methods (offer, poll, * remove() and add) methods; linear time for the