Package introspector.model.traverse
Class WriteTreeTraversal
java.lang.Object
introspector.model.traverse.WriteTreeTraversal
Writes trees with different formats.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidtraverse(Node node, TreeSerializer treeSerializer) Main method to traverse a tree and perform the actions delegated in the tree serializerprivate voidtraverse(Node node, TreeSerializer treeSerializer, int depth, Set<Node> alreadyTraversed) Main method to traverse a tree and perform the actions delegated in the tree serializer
-
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 traversetreeSerializer- the strategy that specifies what to do with each traversal stepdepth- 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
Main method to traverse a tree and perform the actions delegated in the tree serializer- Parameters:
node- the root node to traversetreeSerializer- the strategy that specifies what to do with each traversal step- Throws:
IOException- a textual file is written
-