public class Edge {
private Vertex fromVertex;
private Vertex toVertex;
public Vertex getFromVertex() {
return fromVertex;
}
public void setFromVertex(Vertex fromVertex) {
this.fromVertex = fromVertex;
}
public Vertex getToVertex() {
return toVertex;
}
public void setToVertex(Vertex toVertex) {
this.toVertex = toVertex;
}
public Double getWeight() {
return weight;
}
public void setWeight(Double weight) {
this.weight = weight;
}
private Double weight;
public Edge() {
}
@Override
public String toString() {
return fromVertex.getLabel()+ " to "+
toVertex.getLabel() + "with weigth "+
this.weight;
}
}
新闻热点
疑难解答