public class Edge { private final Node from; private final Node too; private final String id; public Edge(Node f, Node t, String id) { from=f; too=t; this.id=id; } public Node getFrom() { return from; } public NodegetToo() { return too; } public String toString() { return String.format("<%s F:%s T:%s>", this.id, from.toString(), too.toString()); } }