|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.akiban.sql.parser.HasNodeVisitor
public class HasNodeVisitor
Find out if we have a particular node anywhere in the tree. Stop traversal as soon as we find one.
Can find any type of node -- the class or class name of the target node is passed in as a constructor parameter.
| Field Summary | |
|---|---|
protected boolean |
hasNode
|
| Constructor Summary | |
|---|---|
HasNodeVisitor(Class nodeClass)
Construct a visitor |
|
HasNodeVisitor(Class nodeClass,
Class skipOverClass)
Construct a visitor |
|
| Method Summary | |
|---|---|
boolean |
hasNode()
Indicate whether we found the node in question |
void |
reset()
Reset the status so it can be run again. |
boolean |
skipChildren(Visitable node)
Don't visit childen under the skipOverClass node, if it isn't null. |
boolean |
stopTraversal()
Stop traversal if we found the target node |
Visitable |
visit(Visitable node)
If we have found the target node, we are done. |
boolean |
visitChildrenFirst(Visitable node)
Visit parent before children. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean hasNode
| Constructor Detail |
|---|
public HasNodeVisitor(Class nodeClass)
nodeClass - the class of the node that
we are looking for.
public HasNodeVisitor(Class nodeClass,
Class skipOverClass)
nodeClass - the class of the node that
we are looking for.skipOverClass - do not go below this
node when searching for nodeClass.| Method Detail |
|---|
public Visitable visit(Visitable node)
visit in interface Visitornode - the node to process
public boolean stopTraversal()
stopTraversal in interface Visitorpublic boolean skipChildren(Visitable node)
skipChildren in interface Visitornode - the node to process
public boolean visitChildrenFirst(Visitable node)
visitChildrenFirst in interface Visitornode - the top node of a sub-tree about to be visited
true if node's children should be visited
before node, false otherwisepublic boolean hasNode()
public void reset()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||