39 lines
735 B
Java
39 lines
735 B
Java
package graph;
|
|
|
|
public abstract class Edge {
|
|
private String name;
|
|
private Vertex source;
|
|
private Vertex destination;
|
|
|
|
public Edge() {}
|
|
|
|
public Edge(String s, Vertex n1, Vertex n2) {
|
|
this.name = s;
|
|
this.source = n1;
|
|
this.destination = n2;
|
|
}
|
|
|
|
public Vertex getDestination() {
|
|
return destination;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public Vertex getSource() {
|
|
return source;
|
|
}
|
|
|
|
public void setDestination(Vertex n) {
|
|
this.destination = n;
|
|
}
|
|
|
|
public void setName(String s) {
|
|
this.name = s;
|
|
}
|
|
|
|
public void setSource(Vertex n) {
|
|
this.source = n;
|
|
}
|
|
} |