Uebungsaufgaben/graph/Edge.java
2024-06-15 16:35:42 +02:00

53 lines
812 B
Java

package graph;
public abstract class Edge {
private String name;
private Vertex source;
private Vertex destination;
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;
}
public String getName() {
return this.name;
}
public Vertex getSource() {
return this.source;
}
public Vertex getDestination() {
return this.destination;
}
public void setName(String s) {
this.name = s;
}
public void setSource(Vertex n) {
this.source = n;
}
public void setDestination(Vertex n) {
this.destination = n;
}
}