Class WriteTreeTraversal

java.lang.Object
introspector.model.traverse.WriteTreeTraversal

public class WriteTreeTraversal extends Object
Writes trees with different formats.
  • Constructor Details

    • WriteTreeTraversal

      public WriteTreeTraversal()
  • Method Details

    • traverse

      private void traverse(Node node, TreeSerializer treeSerializer, int depth, Set<Node> alreadyTraversed) throws IOException
      Main method to traverse a tree and perform the actions delegated in the tree serializer
      Parameters:
      node - the root node to traverse
      treeSerializer - the strategy that specifies what to do with each traversal step
      depth - the depth of the traversed node (zero for the root node)
      alreadyTraversed - the list of nodes that have been visited in this traversal
      Throws:
      IOException - a textual file is written
    • traverse

      public void traverse(Node node, TreeSerializer treeSerializer) throws IOException
      Main method to traverse a tree and perform the actions delegated in the tree serializer
      Parameters:
      node - the root node to traverse
      treeSerializer - the strategy that specifies what to do with each traversal step
      Throws:
      IOException - a textual file is written