|
mwalk Platform 0.3.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mwalk.visitor.AbstractVisitor | +--mwalk.visitor.GlobalVisitor
A compund visitor which runs a pair of visitors, one walking up the tree and a second which walks back down.
Field Summary | |
private static java.lang.String |
CFG_BASE
Base of keys in configuration file |
protected DownVisitor |
dv
Visitor to use while walking down the tree |
protected boolean |
goingUp
Flag indicating whether we are currently walking up the tree |
protected long |
round
Current round |
protected long |
rounds
Number of rounds and current repitition |
protected UpVisitor |
uv
Visitor to use while walking up the tree |
Fields inherited from class mwalk.visitor.AbstractVisitor |
CFG_BASE,
eval,
seen,
verbose |
Constructor Summary | |
GlobalVisitor()
Default constructor. |
|
GlobalVisitor(DownVisitor dv)
|
|
GlobalVisitor(DownVisitor dv,
int rounds)
|
|
GlobalVisitor(int rounds)
|
|
GlobalVisitor(UpVisitor uv,
DownVisitor dv)
|
|
GlobalVisitor(UpVisitor uv,
DownVisitor dv,
int rounds)
|
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. |
TreeNode[] |
getParents(Tree tree,
TreeNode node)
Get a list of parents for the current node applying correct activity semantics. |
java.util.Enumeration |
getReceivers(Tree tree)
Get a list of active receivers. |
boolean |
init(Tree tree)
Initialize the visitor state. |
boolean |
nextReceiver(Tree tree,
Receiver recv)
Check whether the next receiver should start a visiting path. |
boolean |
postfix()
Whether to visit after visiting parent/children. |
boolean |
prefix()
Whether to visit prior to visiting parent/children. |
void |
prepare(Tree tree)
Prepare the up/down visitors for a new pass over the tree. |
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. |
java.lang.Object |
visitDown(Tree tree,
TreeNode node,
java.util.Vector list)
Visit the current node after visiting children. |
java.lang.Object |
visitUp(Tree tree,
TreeNode node)
Visit the current node prior to visiting parent. |
java.lang.Object |
visitUp(Tree tree,
TreeNode node,
java.util.Vector list)
Visit the current node after visiting parent. |
boolean |
walkDown()
Whether to walk down the tree. |
boolean |
walkUp()
Whether to walk up the tree. |
Methods inherited from class mwalk.visitor.AbstractVisitor |
cfgBoolean,
cfgInt,
cfgString,
cfgVisitor,
evaluator,
evaluator,
haveSeen,
haveVisited,
markSeen,
markVisited,
verbose |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final java.lang.String CFG_BASE
protected UpVisitor uv
protected DownVisitor dv
protected boolean goingUp
protected long rounds
protected long round
Constructor Detail |
public GlobalVisitor()
public GlobalVisitor(int rounds)
public GlobalVisitor(DownVisitor dv)
public GlobalVisitor(UpVisitor uv, DownVisitor dv)
public GlobalVisitor(DownVisitor dv, int rounds)
public GlobalVisitor(UpVisitor uv, DownVisitor dv, int rounds)
Method Detail |
public boolean prefix()
boolean
whether to visit priorpublic boolean postfix()
boolean
whether to visit afterpublic boolean walkUp()
boolean
whether to walk up the treepublic boolean walkDown()
boolean
whether to walk down the treepublic boolean init(Tree tree)
Tree
- current tree instancepublic void reset(Tree tree)
Tree
- vistited treepublic boolean again(Tree tree)
Tree
- vistited treeboolean
whether to walk againpublic void prepare(Tree tree)
Tree
- vistited treepublic boolean nextReceiver(Tree tree, Receiver recv)
Tree
- current tree instanceReceiver
- next receiverboolean
whether to visit next receiverpublic java.util.Enumeration getReceivers(Tree tree)
Tree
- current tree instanceEnumeration
list of receivers to visitpublic java.lang.Object visitUp(Tree tree, TreeNode node) throws VisitException
Tree
- current tree instanceTreeNode
- current nodeObject
optional return value to pass back along the pathVisitException
- if a problem ocurred during visitpublic java.lang.Object visitUp(Tree tree, TreeNode node, java.util.Vector list) throws VisitException
Tree
- current tree instanceTreeNode
- current nodeObject
- list of return values passed back along the pathObject
optional return value to pass back along the pathVisitException
- if a problem ocurred during visitpublic java.lang.Object visitDown(Tree tree, TreeNode node) throws VisitException
Tree
- current tree instanceTreeNode
- current nodeObject
optional return value to pass back along the pathVisitException
- if a problem ocurred during visitpublic java.lang.Object visitDown(Tree tree, TreeNode node, java.util.Vector list) throws VisitException
Tree
- current tree instanceTreeNode
- current nodeObject
- list of return values passed back along the pathObject
optional return value to pass back along the pathVisitException
- if a problem ocurred during visitpublic TreeNode[] getParents(Tree tree, TreeNode node)
Tree
- current tree instanceTreeNode
- current nodeTreeNode[]
array of active parent nodespublic TreeNode[] getChildren(Tree tree, TreeNode node)
Tree
- current tree instanceTreeNode
- current nodeTreeNode[]
list of active children nodes
|
mwalk Platform 0.3.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |