mwalk Platform 0.3.0

mwalk.visitor
Class ExportVisitor

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

public class ExportVisitor
extends PrintVisitor
implements DownVisitor

A visitor that exports an ascii representation of the current 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  int nextID
          Integer count used to assign virtual IDs to nodes
protected  boolean showIP
          Whether to export true IP address or whether to mangle it
 
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
ExportVisitor()
          Default constructor.
ExportVisitor(java.lang.String filename)
          Constructor.
 
Method Summary
 boolean again(Tree tree)
          Determine whether to walk the tree again.
protected  java.lang.String getID(TreeNode node)
          Return the node's ID.
 boolean init(Tree tree)
          Initialize visitor.
 boolean prefix()
          Whether to visit prior to visiting parent/children.
 void reset(Tree tree)
          Reset visitor state.
 java.lang.Object visitDown(Tree tree, TreeNode node)
          Visit the current node prior to visiting children.
 
Methods inherited from class mwalk.visitor.PrintVisitor
getChildren, 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

showIP

protected boolean showIP
Whether to export true IP address or whether to mangle it

nextID

protected int nextID
Integer count used to assign virtual IDs to nodes
Constructor Detail

ExportVisitor

public ExportVisitor()
Default constructor.

ExportVisitor

public ExportVisitor(java.lang.String filename)
Constructor.
Parameters:
String - export filename
Method Detail

prefix

public boolean prefix()
Description copied from interface: Visitor
Whether to visit prior to visiting parent/children.
Overrides:
prefix in class AbstractVisitor
Tags copied from interface: Visitor
Returns:
boolean whether to visit prior

init

public boolean init(Tree tree)
Initialize visitor.
Overrides:
init in class PrintVisitor
Parameters:
Tree - current tree instance

reset

public void reset(Tree tree)
Reset visitor state.
Overrides:
reset in class AbstractVisitor
Parameters:
Tree - current tree instance

again

public boolean again(Tree tree)
Determine whether to walk the tree again.
Overrides:
again in class AbstractVisitor
Parameters:
Tree - current tree instance
Returns:
boolean whether to walk again

visitDown

public java.lang.Object visitDown(Tree tree,
                                  TreeNode node)
Visit the current node prior to visiting children.
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

getID

protected java.lang.String getID(TreeNode node)
Return the node's ID. If showIP is not true, then the IP address will be mangled first.
Parameters:
TreeNode - current node
Returns:
String node's ID

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