Class brs.ToString
- public class ToString
- extends Object
- implements brs.IVisitor
Computes a String representation of the binary tree host so that it can be
printed vertically.
- Author:
- Dung X. Nguyen - Copyright 2000 - All rights reserved.

Singleton

ToString
()

emptyCase
(BiTree, Object[])
- Returns "[]", a String representation of an empty binary tree
nonEmptyCase
(BiTree, Object[])
- Computes a String representation of the binary tree host so that it can

Singleton
public static final ToString Singleton = new ToString ()

ToString
private ToString()

emptyCase
public Object emptyCase(BiTree host, Object[] nu)
- Returns "[]", a String representation of an empty binary tree.
- Parameters:
- host - an empty binary tree.
- nu - not used.
- Returns:
- String
nonEmptyCase
public Object nonEmptyCase(BiTree host, Object[] nu)
- Computes a String representation of the binary tree host so that it can
be printed vertically. There is no '\n' at the end of the String. Passes
appropriate leftmost leading String to a helper visitor to compute the
String representations of the left and right subtrees.
- Parameters:
- host - a non-empty binary tree.
- nu - not used.
- Returns:
- String