mwalk Platform 0.3.0

mwalk.visitor
Class VisualVisitor

java.lang.Object
  |
  +--mwalk.visitor.AbstractVisitor
        |
        +--mwalk.visitor.PrintVisitor
              |
              +--mwalk.visitor.VisualVisitor

public class VisualVisitor
extends PrintVisitor
implements DownVisitor

A visitor that outputs a data set that can be used to visualize the tree.

Version:
1.0
Author:
Robert Chalmers

Field Summary
private static java.lang.String CFG_BASE
          Base of keys in configuration file
private static java.lang.String DEF_FILENAME
          Default file name if none supplied
protected  boolean showIP
           
protected  int time
           
protected  long[] times
           
 
Fields inherited from class mwalk.visitor.PrintVisitor
CFG_BASE, def_filename, filename, ps
 
Fields inherited from class mwalk.visitor.AbstractVisitor
CFG_BASE, eval, seen, verbose
 
Constructor Summary
VisualVisitor()
          Default constructor.
VisualVisitor(long[] times)
           
 
Method Summary
 boolean again(Tree tree)
          Check whether the visitor wants another pass over the tree.
 TreeNode[] getChildren(Tree tree, TreeNode node)
          Get a list of children for the current node applying correct activity semantics.
 boolean init(Tree tree)
          Initialize the visitor state.
 boolean prefix()
          Whether to visit prior to visiting parent/children.
 void reset(Tree tree)
          Reset the visitor for a new pass over the tree.
 java.lang.Object visitDown(Tree tree, TreeNode node)
          Visit the current node prior to visiting children.
 
Methods inherited from class mwalk.visitor.PrintVisitor
getFilename, printData, printData, printHeader, setFilename
 
Methods inherited from class mwalk.visitor.AbstractVisitor
cfgBoolean, cfgInt, cfgString, cfgVisitor, evaluator, evaluator, getParents, getReceivers, haveSeen, haveVisited, markSeen, markVisited, nextReceiver, postfix, verbose, visitDown, visitUp, visitUp, walkDown, walkUp
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

CFG_BASE

private static final java.lang.String CFG_BASE
Base of keys in configuration file

DEF_FILENAME

private static final java.lang.String DEF_FILENAME
Default file name if none supplied

times

protected long[] times

time

protected int time

showIP

protected boolean showIP
Constructor Detail

VisualVisitor

public VisualVisitor()
Default constructor.

VisualVisitor

public VisualVisitor(long[] times)
Method Detail

prefix

public boolean prefix()
Whether to visit prior to visiting parent/children.
Overrides:
prefix in class AbstractVisitor
Returns:
boolean whether to visit prior

init

public boolean init(Tree tree)
Initialize the visitor state.
Overrides:
init in class PrintVisitor
Parameters:
Tree - current tree instance
Returns:
boolean whether to walk again

reset

public void reset(Tree tree)
Reset the visitor for a new pass over the tree.
Overrides:
reset in class AbstractVisitor
Parameters:
Tree - vistited tree

again

public boolean again(Tree tree)
Check whether the visitor wants another pass over the tree.
Overrides:
again in class AbstractVisitor
Parameters:
Tree - vistited tree
Returns:
boolean whether to walk again

visitDown

public java.lang.Object visitDown(Tree tree,
                                  TreeNode node)
Visit the current node prior to visiting children. This method is called if prefix() returns true.
Specified by:
visitDown in interface DownVisitor
Overrides:
visitDown in class AbstractVisitor
Parameters:
Tree - current tree instance
TreeNode - current node
Returns:
Object optional return value to pass back along the path
Throws:
VisitException - if a problem ocurred during visit

getChildren

public TreeNode[] getChildren(Tree tree,
                              TreeNode node)
Get a list of children for the current node applying correct activity semantics.
Specified by:
getChildren in interface DownVisitor
Overrides:
getChildren in class PrintVisitor
Parameters:
Tree - current tree instance
TreeNode - current node
Returns:
TreeNode[] list of active children nodes

mwalk Platform 0.3.0

Submit a bug or feature mwalk Platform API Specification 0.3.0
Sensitivity: {Public:Research}
Copyright(c) 2000, Robert Chalmers