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

Comparing jsr166/src/main/java/util/PriorityQueue.java (file contents):
Revision 1.44 by dl, Sat Oct 18 12:29:27 2003 UTC vs.
Revision 1.50 by dl, Wed Jun 2 23:45:46 2004 UTC

# Line 1 | Line 1
1   /*
2   * %W% %E%
3   *
4 < * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
4 > * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5   * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6   */
7  
# Line 32 | Line 32 | package java.util;
32   * grows automatically.  The details of the growth policy are not
33   * specified.
34   *
35 < * <p>This class implements all of the <em>optional</em> methods of
36 < * the {@link Collection} and {@link Iterator} interfaces.  The
35 > * <p>This class and its iterator implement all of the
36 > * <em>optional</em> methods of the {@link Collection} and {@link
37 > * Iterator} interfaces.
38 > * The
39   * Iterator provided in method {@link #iterator()} is <em>not</em>
40   * guaranteed to traverse the elements of the PriorityQueue in any
41   * particular order. If you need ordered traversal, consider using
# Line 59 | Line 61 | package java.util;
61   * @since 1.5
62   * @version %I%, %G%
63   * @author Josh Bloch
64 < * @param <E> the base class of all elements held in this collection
64 > * @param <E> the type of elements held in this collection
65   */
66   public class PriorityQueue<E> extends AbstractQueue<E>
67 <    implements Queue<E>, java.io.Serializable {
67 >    implements java.io.Serializable {
68  
69      private static final long serialVersionUID = -7720805057305804111L;
70  
# Line 199 | Line 201 | public class PriorityQueue<E> extends Ab
201      public PriorityQueue(Collection<? extends E> c) {
202          initializeArray(c);
203          if (c instanceof SortedSet) {
204 <            // @fixme double-cast workaround for compiler
203 <            SortedSet<? extends E> s = (SortedSet<? extends E>) (SortedSet)c;
204 >            SortedSet<? extends E> s = (SortedSet<? extends E>)c;
205              comparator = (Comparator<? super E>)s.comparator();
206              fillFromSorted(s);
207          } else if (c instanceof PriorityQueue) {
# Line 326 | Line 327 | public class PriorityQueue<E> extends Ab
327          return offer(o);
328      }
329  
330 +    /**
331 +     * Removes a single instance of the specified element from this
332 +     * queue, if it is present.
333 +     */
334      public boolean remove(Object o) {
335          if (o == null)
336              return false;
# Line 457 | Line 462 | public class PriorityQueue<E> extends Ab
462      }
463  
464      /**
465 <     * Remove all elements from the priority queue.
465 >     * Removes all elements from the priority queue.
466 >     * The queue will be empty after this call returns.
467       */
468      public void clear() {
469          modCount++;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines