|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.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 | |
private boolean |
hasNode
|
private java.lang.Class |
nodeClass
|
private java.lang.Class |
skipOverClass
|
Constructor Summary | |
HasNodeVisitor(java.lang.Class nodeClass)
Construct a visitor |
|
HasNodeVisitor(java.lang.Class nodeClass,
java.lang.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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean hasNode
private java.lang.Class nodeClass
private java.lang.Class skipOverClass
Constructor Detail |
public HasNodeVisitor(java.lang.Class nodeClass)
nodeClass
- the class of the node that
we are looking for.public HasNodeVisitor(java.lang.Class nodeClass, java.lang.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 Visitor
node
- the node to process
public boolean stopTraversal()
stopTraversal
in interface Visitor
public boolean skipChildren(Visitable node)
skipChildren
in interface Visitor
node
- the node to process
public boolean hasNode()
public void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |