ProjektGraph/graph/MarkedEdge.java
cmerkens 7982917710 ...
2024-06-25 17:18:34 +02:00

63 lines
1.0 KiB
Java

package graph;
public class MarkedEdge<U extends EdgeMarking> extends Edge{
// ATTRIBUTE
private U marking;
// Für Aufgabe 2
private int weighting;
// KONSTRUKTOREN
public MarkedEdge() {
super();
}
public MarkedEdge(String s, Vertex n1, Vertex n2, U u) {
super(s, n1, n2);
this.marking = u;
}
public MarkedEdge(String s, Vertex n1, Vertex n2, U u, int w) {
super(s, n1, n2);
this.marking = u;
this.weighting = w;
}
// GET-ER
public U getMarking() {
return this.marking;
}
// Für Aufgabe 2
public int getWeighting() {
return this.weighting;
}
// SET-ER
public void setMarking(U u) {
this.marking = u;
}
// Für Aufgabe 2
public void setWeighting(int w) {
this.weighting = w;
}
// Ausgabe
public String toString() {
return "MarkedEdge " + this.getName() + " from " + this.getSource().getName() + " to " + this.getDestination().getName();
}
}