
A class to support representation of the TreeNode tree as a String. Note that there is a similar class, TreeToXML which will serialize the in-memory tree back to XML.
For those of you who speak the "gang of four" Design Patterns languauge, this class follows a "visitor" pattern.
Public Member Functions | |
| TreeToString (TreeNode root) | |
| String | toString () |
Private Member Functions | |
| void | indent () |
| void | openAngle () |
| void | closeAngle (boolean first) |
| void | nodeToString (TreeNode node) |
| void | leavesToString (TreeNode root) |
| void | rootToString (TreeNode root) |
Private Attributes | |
| final char | startChar = '<' |
| final char | endChar = '>' |
| TreeNode | mRoot |
| StringBuffer | mBuf = null |
| final int | INDENT = 2 |
| int | mIndentLevel |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.8