ProjektGraph/graph/MarkedEdge.java

54 lines
934 B
Java

package graph;
public class MarkedEdge<U extends EdgeMarking, T extends VertexMarking> extends Edge{
// ATTRIBUTE
// private MarkedVertex<T> source;
// private MarkedVertex<T> destination;
private U marking;
// KONSTRUKTOREN
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;
}
public U getMarking() {
return this.marking;
}
// SET-ER
public void setMarking(U u) {
this.marking = u;
}
// Ausgabe
public String toString() {
return "MarkedEdge " + this.getName() + " from " + this.getSource().getName() + " to " + this.getDestination().getName();
}
}