|
|||||||||
| 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
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
|
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. |
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
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 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()
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||