uk.ac.bbk.dcs.automed.graph
Class Forest
java.lang.Object
uk.ac.bbk.dcs.automed.graph.Forest
public class Forest
- extends java.lang.Object
Class that abstracts the structure of a forest.
- Author:
- Lucas Zamboulis
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
genericRootName
public static final java.lang.String genericRootName
- See Also:
- Constant Field Values
Forest
public Forest()
getForest
public java.util.HashSet getForest()
- Returns:
- the roots of the trees consisting the forest
addTree
public void addTree(TreeNode root)
- Adds a tree to the forest.
- Parameters:
root - the root of the tree
forestToTree
public TreeNode forestToTree()
- This method adds a generic root node to the forest and adds the trees' roots as children to the generic root node.
As a result, the forest is transformed into a tree.
- Returns:
- the root node of the newly created tree
printForest
public void printForest()
printTree
protected void printTree(TreeNode root,
int depth)