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 Object | clone() Returns a copy of the object. |
public Object | get(Object key) It returns the value associated with the key in the map. |
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. |
public String | toString() The textual representation of the graph node. |