code von priority repariert
parent
2a28e3a16e
commit
010057da87
|
@ -1,15 +1,15 @@
|
|||
package Queue;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.*;
|
||||
import java.time.LocalDate;
|
||||
import java.util.PriorityQueue;
|
||||
|
||||
public class Reklamation implements Comparable<Reklamation> {
|
||||
String kundennr;
|
||||
Date datum;
|
||||
LocalDate datum;
|
||||
String beschreibung;
|
||||
Prioritaet prio;
|
||||
|
||||
public Reklamation(String string, Date datum, String b, Prioritaet prio) {
|
||||
public Reklamation(String string, LocalDate datum, String b, Prioritaet prio) {
|
||||
this.kundennr = string;
|
||||
this.datum = datum;
|
||||
this.beschreibung = b;
|
||||
|
@ -32,17 +32,19 @@ public class Reklamation implements Comparable<Reklamation> {
|
|||
public static void main(String[] args) {
|
||||
PriorityQueue<Reklamation> reklamationen = new PriorityQueue<>();
|
||||
reklamationen
|
||||
.add(new Reklamation("Lisa Mayer", new Date(1234567890), "Handybildschirm kaputt", Prioritaet.BRONZE));
|
||||
reklamationen.add(new Reklamation("Hanna Montana", new Date(1234567900),
|
||||
.add(new Reklamation("Lisa Mayer", LocalDate.of(2009, 2, 14), "Handybildschirm kaputt", Prioritaet.BRONZE));
|
||||
reklamationen.add(new Reklamation("Hanna Montana", LocalDate.of(2009, 2, 14),
|
||||
"20 Laptops müssen vor Sa repariert werden", Prioritaet.GOLD));
|
||||
reklamationen.add(new Reklamation("Herbert Grönemayer", new Date(1234567910), "braucht neues Softwareupdate",
|
||||
reklamationen.add(new Reklamation("Herbert Grönemayer", LocalDate.of(2009, 2, 14), "braucht neues Softwareupdate",
|
||||
Prioritaet.SILBER));
|
||||
reklamationen.add(new Reklamation("KSI", new Date(1234567920), "neue Iphone Bestellung nicht angekommen",
|
||||
reklamationen.add(new Reklamation("KSI",LocalDate.of(2009, 2, 14), "neue Iphone Bestellung nicht angekommen",
|
||||
Prioritaet.BRONZE));
|
||||
|
||||
for (Reklamation reklamation : reklamationen) {
|
||||
System.out.println(reklamation.kundennr + " - " + reklamation.beschreibung + " (" + reklamation.prio + ")");
|
||||
}
|
||||
|
||||
while (!reklamationen.isEmpty()) {
|
||||
Reklamation reklamation = reklamationen.poll();
|
||||
System.out.println(reklamation.kundennr + " - " + reklamation.beschreibung + " (" + reklamation.prio + ")");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue