com.ebasetech.ufs.utility
Class TreeWriter
java.lang.Object
com.ebasetech.ufs.utility.TreeWriter
- All Implemented Interfaces:
- TreeVisitor
- public class TreeWriter
- extends java.lang.Object
- implements TreeVisitor
TreeVisitor for writing out all nodes. Construct with a PrintWriter to write nodes to
Field Summary |
private int |
indent
|
private java.io.PrintWriter |
pw
|
Constructor Summary |
TreeWriter(java.io.PrintWriter pw)
|
Method Summary |
void |
endVisit(TreeNode node)
called after all child nodes have been visited |
private void |
indent(java.io.PrintWriter pw,
int indent)
|
boolean |
startVisit(TreeNode node)
called when a node is found |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
indent
private int indent
pw
private java.io.PrintWriter pw
TreeWriter
public TreeWriter(java.io.PrintWriter pw)
indent
private void indent(java.io.PrintWriter pw,
int indent)
startVisit
public boolean startVisit(TreeNode node)
- Description copied from interface:
TreeVisitor
- called when a node is found
- Specified by:
startVisit
in interface TreeVisitor
- Returns:
- true if you want to recurse into this node
endVisit
public void endVisit(TreeNode node)
- Description copied from interface:
TreeVisitor
- called after all child nodes have been visited
- Specified by:
endVisit
in interface TreeVisitor