import java.util.List; import java.util.ArrayList; /** A node with a name and list of directed edges (edges do not * have labels). */ public class Node implements Comparable { ... define name field ... /** The list of node names targeted by edges. Use symbolic names * rather than Node ptrs so we can do forward refs easily. */ ... define edges field ... public Node(String name) { } /** Add an edge if it doesn't already exist */ public void addEdge(String target) { } public String toString() { return name; } /** This method allows us to test a Node against a list for * membership and is also needed for the Collections.sort(). */ public int compareTo(Object o) { return name.compareTo(((Node)o).name); } }