public class DefaultGraphWalker extends Object implements GraphWalker
Modifier and Type | Field and Description |
---|---|
protected Dispatcher |
dispatcher |
protected Stack<Node> |
opStack |
protected IdentityHashMap<Node,Object> |
retMap |
protected List<Node> |
toWalk |
Constructor and Description |
---|
DefaultGraphWalker(Dispatcher disp)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
dispatch(Node nd,
Stack<Node> ndStack)
Dispatch the current operator.
|
<T> T |
dispatchAndReturn(Node nd,
Stack<Node> ndStack)
Returns dispatch result
|
Set<Node> |
getDispatchedList() |
List<Node> |
getToWalk() |
void |
startWalking(Collection<Node> startNodes,
HashMap<Node,Object> nodeOutput)
starting point for walking.
|
void |
walk(Node nd)
walk the current operator and its descendants.
|
protected final IdentityHashMap<Node,Object> retMap
protected final Dispatcher dispatcher
public DefaultGraphWalker(Dispatcher disp)
disp
- dispatcher to call for each op encounteredpublic void dispatch(Node nd, Stack<Node> ndStack) throws SemanticException
nd
- node being walkedndStack
- stack of nodes encounteredSemanticException
public <T> T dispatchAndReturn(Node nd, Stack<Node> ndStack) throws SemanticException
SemanticException
public void startWalking(Collection<Node> startNodes, HashMap<Node,Object> nodeOutput) throws SemanticException
startWalking
in interface GraphWalker
startNodes
- list of starting operatorsnodeOutput
- If this parameter is not null, the call to the function returns
the map from node to objects returned by the processors.SemanticException
public void walk(Node nd) throws SemanticException
nd
- current operator in the graphSemanticException
Copyright © 2017 The Apache Software Foundation. All rights reserved.