title: Converting passed in String to Vertex for DirectedGraph
body: <p>Having some trouble with creating vertices and using them in a Directed Graph. </p>
  
  <p>I have two classes to be concerned with: Node.java and Digraph.java</p>
  
  <pre><code>  public class Node {
     private final int vertex;
     private HashSet&lt;Node&gt; outgoingEdges;
  
     public Node(int index) {
      this.index = index;
    }
  
    protected void addOutgoing(Node start) {
      outgoingEdges.add(start);
  }
  
   public class Digraph {
   private Set&lt;Node&gt; vertices;
  
   public Digraph(String str) {
   String eliminatePrefix = str.replaceAll("a", "");
   for (int i = 0; i &lt; eliminatePrefix.length; i++) {
       // Not sure how to proceed
       // 
   }
  
   protected void add(Node a, Node b) {
       a.addOutgoing(b);
   }
  </code></pre>
  
  <p>The String being passed in looks something like [a1, a2][a16, a10]....
  a1 and a2 are vertices. The pairing means there's a directed route from a1 to a2. The Strings need to be parsed and converted, I know, and once they are properly formatted, the addEdge method will be called. I am just trying to figure out this constructor.</p>