Main.pizza
class Main {
public static <T> void print(STORE<T> str) {
while (!str.isEmpty()) {
System.out.println(""+str.remove());
};
}
public static void main(String[] args) {
STORE<TestComp> pq = new PQueue2();
STORE<Number> pq1 = new PQueue1(new NumberComparer());
STORE<int> pq2 = new PQueue1(new IntComparer());
for (int i = 1; i <= 100; i++) {
pq1.add(new Float(i));
pq2.add(i);
};
Integer[] oa1 = new Integer[100];
int[] oa2 = new int[100];
for (int i = 200; i >= 101; i--) {
oa1[200-i]=new Integer(i);
oa2[200-i]=i;
};
pq1.addAll(oa1);
pq2.addAll(oa2);
System.out.println("PQueue: "+pq1); print(pq1);
System.out.println("PQueue: "+pq2); print(pq2);
}
}
class TestComp implements ORDER<TestComp> {
public int compare(TestComp t) {return 0;}
}
On to IntComparer.pizza Part of Priority Queues mit Pizza
Andreas Podelski, Abdelwaheb Ayari, Hubert Baumeister
February 25, 1997
Imprint | Data Protection