mwalk Platform 0.3.0

mwalk.visitor
Class PrintVisitor

java.lang.Object
  |
  +--mwalk.visitor.AbstractVisitor
        |
        +--mwalk.visitor.PrintVisitor
Direct Known Subclasses:
DegreeCountVisitor, ExportVisitor, LinkCountVisitor, MetricVisitor, VisualVisitor

public abstract class PrintVisitor
extends AbstractVisitor

An abstract visitor used as a bas class for visitors wanting to print results out to a log file.

Version:
1.0
Author:
Robert Chalmers

Field Summary
private static java.lang.String CFG_BASE
          Base of keys in configuration file
protected  java.lang.String def_filename
          Default file name if none supplied
protected  java.lang.String filename
          Filename to print to
protected  java.io.PrintStream ps
          Print stream to use for output
 
Fields inherited from class mwalk.visitor.AbstractVisitor
CFG_BASE, eval, seen, verbose
 
Constructor Summary
PrintVisitor()
          Default constructor.
PrintVisitor(java.lang.String filename)
          Constructor.
 
Method Summary
 TreeNode[] getChildren(Tree tree, TreeNode node)
          Get a list of children for the current node applying correct activity semantics.
 java.lang.String getFilename()
          Retrieve the current filename.
 boolean init(Tree tree)
          Initialize visitor.
 void printData(Tree tree, java.lang.String line)
          Print a single line of data.
 void printData(Tree tree, TreeNode node, java.lang.String line)
          Print a single line of data.
protected  void printHeader(Tree tree)
          Print visitor's header info at start of file.
 void setFilename(java.lang.String filename)
          Set the current filename prior to init().
 
Methods inherited from class mwalk.visitor.AbstractVisitor
again, cfgBoolean, cfgInt, cfgString, cfgVisitor, evaluator, evaluator, getParents, getReceivers, haveSeen, haveVisited, markSeen, markVisited, nextReceiver, postfix, prefix, reset, verbose, visitDown, 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

ps

protected java.io.PrintStream ps
Print stream to use for output

filename

protected java.lang.String filename
Filename to print to

def_filename

protected java.lang.String def_filename
Default file name if none supplied
Constructor Detail

PrintVisitor

public PrintVisitor()
Default constructor.

PrintVisitor

public PrintVisitor(java.lang.String filename)
Constructor.
Parameters:
String - new default filename
Method Detail

getFilename

public java.lang.String getFilename()
Retrieve the current filename.
Returns:
String current filename

setFilename

public void setFilename(java.lang.String filename)
Set the current filename prior to init().
Parameters:
String - new filename

printHeader

protected void printHeader(Tree tree)
Print visitor's header info at start of file.
Parameters:
Tree - current tree instance

printData

public void printData(Tree tree,
                      TreeNode node,
                      java.lang.String line)
Print a single line of data.
Parameters:
Tree - current tree instance
TreeNode - current tree node
String - line to print

printData

public void printData(Tree tree,
                      java.lang.String line)
Print a single line of data.
Parameters:
Tree - current tree instance
String - line to print

init

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

getChildren

public TreeNode[] getChildren(Tree tree,
                              TreeNode node)
Get a list of children for the current node applying correct activity semantics.
Overrides:
getChildren in class AbstractVisitor
Parameters:
Tree - current tree instance
TreeNode - current node

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