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.7 by dl, Tue Jun 24 14:34:30 2003 UTC vs.
Revision 1.8 by dl, Tue Jul 1 16:29:45 2003 UTC

# Line 31 | Line 31
31   * @author Josh Bloch
32   */
33   public class PriorityQueue<E> extends AbstractQueue<E>
34 <                              implements Queue<E> {
34 >                              implements Queue<E>,
35 >                                         java.io.Serializable {
36      private static final int DEFAULT_INITIAL_CAPACITY = 11;
37  
38      /**
# Line 127 | Line 128 | public class PriorityQueue<E> extends Ab
128              initialCapacity = 1;
129          queue = new E[initialCapacity + 1];
130  
130        /* Commented out to compile with generics compiler
131  
132          if (initialElements instanceof Sorted) {
133              comparator = ((Sorted)initialElements).comparator();
134              for (Iterator<E> i = initialElements.iterator(); i.hasNext(); )
135                  queue[++size] = i.next();
136          } else {
137        */
138        {
137              comparator = null;
138              for (Iterator<E> i = initialElements.iterator(); i.hasNext(); )
139                  add(i.next());
# Line 414 | Line 412 | public class PriorityQueue<E> extends Ab
412       * @return the comparator associated with this priority queue, or
413       *         <tt>null</tt> if it uses its elements' natural ordering.
414       */
415 <    Comparator comparator() {
415 >    public Comparator comparator() {
416          return comparator;
417      }
418  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines