Package introspector.model.traverse
Interface TreeSerializer
- All Known Implementing Classes:
ConsoleTreeSerializer,HtmlTreeSerializer,TreeSerializerMock,TxtTreeSerializer
public interface TreeSerializer
Defines the operations to be defined so that a tree could be stored
-
Method Summary
Modifier and TypeMethodDescriptionvoidafterTraversing(Node node, int depth, boolean hasBeenVisited) This method is called after one node is traversedvoidbeforeTraversing(Node node, int depth, boolean hasBeenVisited) This method is called after the whole tree has been traversedvoidThis method is called at the beginning of the tree traversalvoidThis method is called after the whole tree has been traversedvoidtraversing(Node node, int depth, boolean hasBeenVisited) This method is called when a node is being traversed
-
Method Details
-
beginTraverse
This method is called at the beginning of the tree traversal- Throws:
IOException- if there is an error writing the tree
-
endTraverse
This method is called after the whole tree has been traversed- Throws:
IOException- if there is an error writing the tree
-
beforeTraversing
This method is called after the whole tree has been traversed- Parameters:
node- the node that is up to be traverseddepth- the depth of the nodehasBeenVisited- if the node has already been visited in the current traversal (to detect cycles)- Throws:
IOException- if there is an error writing the tree
-
traversing
This method is called when a node is being traversed- Parameters:
node- the node that is up being traverseddepth- the depth of the nodehasBeenVisited- if the node has already been visited in the current traversal (to detect cycles)- Throws:
IOException- if there is an error writing the tree
-
afterTraversing
This method is called after one node is traversed- Parameters:
node- the node that has just been traverseddepth- the depth of the nodehasBeenVisited- if the node has already been visited in the current traversal (to detect cycles)- Throws:
IOException- if there is an error writing the tree
-