Method Summary |
|
public void | addEdge(String parent, String child) Adds an edge between two already existing nodes in the graph. |
public void | addEdges(String child, List parents) A convenience method that allows for bulk addition of edges between
already existing nodes in the graph. |
public void | addNode(GraphNode node) Adds a node to the Graph. |
public void | addRoot(GraphNode root) Adds a single root node to the Graph. |
public List | getLeaves() Returns the leaf nodes of the Graph. |
public GraphNode | getNode(String identifier) Returns the node matching the id passed.
Parameters: identifier - the id of the node. |
public List | getRoots() Returns the root nodes of the Graph. |
public Iterator | iterator() Returns an iterator that traverses through the graph using a graph
traversal algorithm. |
public Iterator | nodeIterator() Returns an iterator for the nodes in the Graph. |
public boolean | remove(String identifier) Removes a node from the Graph.
Parameters: identifier - the id of the node to be removed. |