1package ds.util;
2
3
4
5
6public
7 class P implements Comparable<P> {
8
9 public final int prio;
10
11 public P(int p) {
12 prio = p;
13 }
14
15
16 public static P mkP(int v) {
17 return
18 new P(v);
19 }
20
21 public int compareTo(P p2) {
22 if (prio == p2.prio)
23 return 0;
24 if (prio > p2.prio)
25 return 1;
26 else
27 return -1;
28 }
29
30 public boolean equalTo(P p2) {
31 return
32 compareTo(p2) == 0;
33 }
34
35 public String toString() {
36 return "" + prio;
37 }
38}