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

Comparing jsr166/src/main/java/util/concurrent/PriorityBlockingQueue.java (file contents):
Revision 1.55 by jsr166, Mon Jul 12 20:15:19 2010 UTC vs.
Revision 1.56 by jsr166, Mon Sep 20 20:23:52 2010 UTC

# Line 38 | Line 38 | import java.util.*;
38   * tie-breaking to comparable elements. To use it, you would insert a
39   * <tt>new FIFOEntry(anEntry)</tt> instead of a plain entry object.
40   *
41 < * <pre>
42 < * class FIFOEntry&lt;E extends Comparable&lt;? super E&gt;&gt;
43 < *     implements Comparable&lt;FIFOEntry&lt;E&gt;&gt; {
41 > *  <pre> {@code
42 > * class FIFOEntry<E extends Comparable<? super E>>
43 > *     implements Comparable<FIFOEntry<E>> {
44   *   final static AtomicLong seq = new AtomicLong();
45   *   final long seqNum;
46   *   final E entry;
# Line 49 | Line 49 | import java.util.*;
49   *     this.entry = entry;
50   *   }
51   *   public E getEntry() { return entry; }
52 < *   public int compareTo(FIFOEntry&lt;E&gt; other) {
52 > *   public int compareTo(FIFOEntry<E> other) {
53   *     int res = entry.compareTo(other.entry);
54 < *     if (res == 0 &amp;&amp; other.entry != this.entry)
55 < *       res = (seqNum &lt; other.seqNum ? -1 : 1);
54 > *     if (res == 0 && other.entry != this.entry)
55 > *       res = (seqNum < other.seqNum ? -1 : 1);
56   *     return res;
57   *   }
58 < * }</pre>
58 > * }}</pre>
59   *
60   * <p>This class is a member of the
61   * <a href="{@docRoot}/../technotes/guides/collections/index.html">

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines