1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
|
public interface Comparable {
int compareTo(D other);
}
public class Druckauftrag implementes Comparable{
private int prioritaet;
private String text;
public Druckauftrag(Sting text, int prioritaet){
this. text= text;
this. prioritaet= prioritaet;
}
public void setPrioritaet(int prioritaet){
this. prioritaet= prioritaet;
}
public int getPrioritaet(){
return this.prioritaet;
}
public void settext(String text ){
this. text= text;
}
public String getPrioritaet(){
return this.text;
}
public int compareTo(D other){
if ( other.getPrioritaet<this.Prioritaet){
return -1;
}else {
if (other.getPrioritaet==this.Prioritaet){
return0;
}else {
return 1;
}
}
}
|