ProjektGraph/graph/Edge.java

61 lines
882 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;
}
// 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;
}
}