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

Field Summary
static java.lang.String genericRootName
           
 
Constructor Summary
Forest()
           
 
Method Summary
protected  void addTree(TreeNode root)
          Adds a tree to the forest.
 java.util.HashSet getForest()
           
 void printForest()
           
protected  void printTree(TreeNode root, int depth)
           
 TreeNode toTree()
          This method adds a generic root node to the forest and adds the trees' roots as children to the generic root node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

genericRootName

public static final java.lang.String genericRootName
See Also:
Constant Field Values
Constructor Detail

Forest

public Forest()
Method Detail

getForest

public java.util.HashSet getForest()
Returns:
the roots of the trees consisting the forest

addTree

protected void addTree(TreeNode root)
Adds a tree to the forest.

Parameters:
root - the root of the tree

toTree

public TreeNode toTree()
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)