ProjektGraph/graph/MarkedEdge.java

54 lines
934 B
Java
Raw Normal View History

2024-06-15 14:48:28 +00:00
package graph;
public class MarkedEdge<U extends EdgeMarking, T extends VertexMarking> extends Edge{
2024-06-15 14:48:28 +00:00
// ATTRIBUTE
// private MarkedVertex<T> source;
// private MarkedVertex<T> destination;
2024-06-15 14:48:28 +00:00
private U marking;
// KONSTRUKTOREN
2024-06-15 14:48:28 +00:00
public MarkedEdge() {
super();
}
public MarkedEdge(String s, Vertex n1, Vertex n2, U u) {
super(s, n1, n2);
this.marking = u;
}
// GET-ER
public MarkedVertex<T> getSource() {
return this.source;
}
public MarkedVertex<T> getDestination() {
return this.destination;
}
2024-06-15 14:48:28 +00:00
public U getMarking() {
return this.marking;
}
// SET-ER
2024-06-15 14:48:28 +00:00
public void setMarking(U u) {
this.marking = u;
}
// Ausgabe
2024-06-15 14:48:28 +00:00
public String toString() {
return "MarkedEdge " + this.getName() + " from " + this.getSource().getName() + " to " + this.getDestination().getName();
2024-06-15 14:48:28 +00:00
}
}