java.lang.Object
org.apache.jorphan.collections.HashTree.ConvertToString
- All Implemented Interfaces:
- HashTreeTraverser
- Enclosing class:
- HashTree
- private class HashTree.ConvertToString
- extends java.lang.Object
- implements HashTreeTraverser
string
java.lang.StringBuffer string
spaces
java.lang.StringBuffer spaces
depth
int depth
HashTree.ConvertToString
private HashTree.ConvertToString()
addNode
public void addNode(java.lang.Object key,
HashTree subTree)
- Description copied from interface:
HashTreeTraverser
- The tree traverses itself depth-first, calling addNode for each object it
encounters as it goes. This is a callback method, and should not be
called except by a HashTree during traversal.
- Specified by:
addNode in interface HashTreeTraverser
subtractNode
public void subtractNode()
- Description copied from interface:
HashTreeTraverser
- Indicates traversal has moved up a step, and the visitor should remove
the top node from its stack structure. This is a callback method, and
should not be called except by a HashTree during traversal.
- Specified by:
subtractNode in interface HashTreeTraverser
processPath
public void processPath()
- Description copied from interface:
HashTreeTraverser
- Process path is called when a leaf is reached. If a visitor wishes to
generate Lists of path elements to each leaf, it should keep a Stack data
structure of nodes passed to it with addNode, and removing top items for
every
HashTreeTraverser.subtractNode() 55 call. This is a callback method, and should
not be called except by a HashTree during traversal.
- Specified by:
processPath in interface HashTreeTraverser
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).
getSpaces
private java.lang.String getSpaces()