package graph; import java.util.Comparator; // Exception, das User nach einem ungültigen Knoten sucht public class NameDoesNotExistException extends Exception { public NameDoesNotExistException() { super(); } public NameDoesNotExistException(String message) { super(message); } public NameDoesNotExistException(String message, Throwable cause) { super(message, cause); } public NameDoesNotExistException(Throwable cause) { super(cause); } } // Element in der PriorityQueue class WrapperElement { // ATTRIBUTE private MarkedVertex n1; private double prio; // KONSTRUKTOR public WrapperElement(MarkedVertex n1, double prio) { this.n1 = n1; this.prio = prio; } // GET-ER public MarkedVertex getElement() { return this.n1; } public double getPrio() { return this.prio; } // Ausgabe public String toString() { return "Wrapper with " + this.n1 + " with prio " + this.prio; } } // 2 Elemente in der PriorityQueue Vergleichen class WrapperComparator implements Comparator> { public int compare(WrapperElement element1, WrapperElement element2) { return Double.compare(element1.getPrio(), element2.getPrio()); } }