ProjektGraph/graph/Edge.java
2024-07-03 00:46:21 +02:00

64 lines
948 B
Java

package graph;
public abstract class Edge {
// ATTRIBUTE
private String name;
private Vertex source;
private Vertex destination;
// KONSTRUKTOREN
public Edge() {
this.name = "";
this.source = null;
this.destination = null;
}
public Edge(String s, Vertex n1, Vertex n2) {
this.name = s;
this.source = n1;
this.destination = n2;
}
// GET-ER
public String getName() {
return this.name;
}
public Vertex getSource() {
return this.source;
}
public Vertex getDestination() {
return this.destination;
}
public abstract visualizationElements.Edge getScreenEdge();
// SET-ER
public void setName(String s) {
this.name = s;
}
public void setSource(Vertex n) {
this.source = n;
}
public void setDestination(Vertex n) {
this.destination = n;
}
}