Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.jorphan.collections
Class HashTree.ConvertToString  view HashTree.ConvertToString download HashTree.ConvertToString.java

java.lang.Object
  extended byorg.apache.jorphan.collections.HashTree.ConvertToString
All Implemented Interfaces:
HashTreeTraverser
Enclosing class:
HashTree

private class HashTree.ConvertToString
extends java.lang.Object
implements HashTreeTraverser


Field Summary
(package private)  int depth
           
(package private)  java.lang.StringBuffer spaces
           
(package private)  java.lang.StringBuffer string
           
 
Constructor Summary
private HashTree.ConvertToString()
           
 
Method Summary
 void addNode(java.lang.Object key, HashTree subTree)
          The tree traverses itself depth-first, calling addNode for each object it encounters as it goes.
private  java.lang.String getSpaces()
           
 void processPath()
          Process path is called when a leaf is reached.
 void subtractNode()
          Indicates traversal has moved up a step, and the visitor should remove the top node from its stack structure.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

string

java.lang.StringBuffer string

spaces

java.lang.StringBuffer spaces

depth

int depth
Constructor Detail

HashTree.ConvertToString

private HashTree.ConvertToString()
Method Detail

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()