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.98 by jsr166, Tue Oct 22 15:21:30 2013 UTC vs.
Revision 1.102 by jsr166, Wed Dec 31 07:54:13 2014 UTC

# Line 24 | Line 24
24   */
25  
26   package java.util;
27 +
28   import java.util.function.Consumer;
29   import java.util.stream.Stream;
30  
# Line 77 | Line 78 | import java.util.stream.Stream;
78   *
79   * @since 1.5
80   * @author Josh Bloch, Doug Lea
81 < * @param <E> the type of elements held in this collection
81 > * @param <E> the type of elements held in this queue
82   */
83   public class PriorityQueue<E> extends AbstractQueue<E>
84      implements java.io.Serializable {
# Line 99 | Line 100 | public class PriorityQueue<E> extends Ab
100      /**
101       * The number of elements in the priority queue.
102       */
103 <    private int size = 0;
103 >    private int size;
104  
105      /**
106       * The comparator, or null if priority queue uses elements'
# Line 393 | Line 394 | public class PriorityQueue<E> extends Ab
394       * @return {@code true} if this queue contains the specified element
395       */
396      public boolean contains(Object o) {
397 <        return indexOf(o) != -1;
397 >        return indexOf(o) >= 0;
398      }
399  
400      /**
# Line 476 | Line 477 | public class PriorityQueue<E> extends Ab
477           * Index (into queue array) of element to be returned by
478           * subsequent call to next.
479           */
480 <        private int cursor = 0;
480 >        private int cursor;
481  
482          /**
483           * Index of element returned by most recent call to next,
# Line 496 | Line 497 | public class PriorityQueue<E> extends Ab
497           * We expect that most iterations, even those involving removals,
498           * will not need to store elements in this field.
499           */
500 <        private ArrayDeque<E> forgetMeNot = null;
500 >        private ArrayDeque<E> forgetMeNot;
501  
502          /**
503           * Element returned by the most recent call to next iff that
504           * element was drawn from the forgetMeNot list.
505           */
506 <        private E lastRetElt = null;
506 >        private E lastRetElt;
507  
508          /**
509           * The modCount value that the iterator believes that the backing

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines