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 |
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.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 |
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
ExportVisitor
public ExportVisitor()
- Default constructor.
ExportVisitor
public ExportVisitor(java.lang.String filename)
- Constructor.
- Parameters:
String
- export filename
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 instanceTreeNode
- 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
Submit a bug or feature mwalk Platform API Specification 0.3.0
Sensitivity: {Public:Research}
Copyright(c) 2000, Robert Chalmers