mwalk Platform 0.3.0

mwalk.visitor
Class PathlessVisitor

java.lang.Object
  |
  +--mwalk.visitor.AbstractVisitor
        |
        +--mwalk.visitor.PathlessVisitor

public class PathlessVisitor
extends AbstractVisitor
implements UpVisitor

A visitor used to remove paths that do not lead back to the source.

Version:
1.0
Author:
Robert Chalmers

Field Summary
protected  int edges
          Count of edges removed
protected  int nodes
          Count of nodes removed
protected  java.util.Vector receivers
          List of receivers to remove from the tree
 
Fields inherited from class mwalk.visitor.AbstractVisitor
CFG_BASE, eval, seen, verbose
 
Constructor Summary
PathlessVisitor()
          Default constructor.
 
Method Summary
 int countEdges()
          Return the number of pathless edges in the graph.
 int countNodes()
          Return the number of pathless nodes in the graph.
 int countReceivers()
          Return the number of pathless receivers.
 boolean postfix()
          Whether to visit after visiting parent/children.
 int removeReceivers(Tree tree)
          Remove receivers that were marked as pathless.
 void reset(Tree tree)
          Reset the visitor for a new pass over the tree.
 java.lang.Object visitUp(Tree tree, TreeNode node, java.util.Vector list)
          Visit the current node after visiting parent.
 
Methods inherited from class mwalk.visitor.AbstractVisitor
again, cfgBoolean, cfgInt, cfgString, cfgVisitor, evaluator, evaluator, getChildren, getParents, getReceivers, haveSeen, haveVisited, init, markSeen, markVisited, nextReceiver, prefix, verbose, visitDown, visitDown, visitUp, walkDown, walkUp
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

receivers

protected java.util.Vector receivers
List of receivers to remove from the tree

nodes

protected int nodes
Count of nodes removed

edges

protected int edges
Count of edges removed
Constructor Detail

PathlessVisitor

public PathlessVisitor()
Default constructor.
Method Detail

countReceivers

public int countReceivers()
Return the number of pathless receivers.
Returns:
int number of pathless receivers.

countNodes

public int countNodes()
Return the number of pathless nodes in the graph. This count does not include receivers being removed.
Returns:
int number of pathless nodes

countEdges

public int countEdges()
Return the number of pathless edges in the graph.
Returns:
int number of pathless edges

removeReceivers

public int removeReceivers(Tree tree)
Remove receivers that were marked as pathless.
Parameters:
Tree - current tree
int - number of receivers removed

postfix

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

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

visitUp

public java.lang.Object visitUp(Tree tree,
                                TreeNode node,
                                java.util.Vector list)
                         throws VisitException
Visit the current node after visiting parent.
Specified by:
visitUp in interface UpVisitor
Overrides:
visitUp in class AbstractVisitor
Parameters:
Tree - current tree instance
TreeNode - current node
Object - list of return values passed back along the path
Returns:
Vector optional return value to pass back along the path
Throws:
VisitException - if a problem ocurred during visit

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