|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.CollectNodesVisitor
public class CollectNodesVisitor
Collect all nodes of the designated type to be returned in a vector.
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 java.lang.Class |
nodeClass
|
private java.util.Vector |
nodeList
|
private java.lang.Class |
skipOverClass
|
Constructor Summary | |
---|---|
CollectNodesVisitor(java.lang.Class nodeClass)
Construct a visitor |
|
CollectNodesVisitor(java.lang.Class nodeClass,
java.lang.Class skipOverClass)
Construct a visitor |
Method Summary | |
---|---|
java.util.Vector |
getList()
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()
Method that is called to see if query tree traversal should be stopped before visiting all nodes. |
Visitable |
visit(Visitable node)
If we have found the target node, we are done. |
boolean |
visitChildrenFirst(Visitable node)
Method that is called to see if visit() should be called on
the children of node before it is called on node itself. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Vector nodeList
private java.lang.Class nodeClass
private java.lang.Class skipOverClass
Constructor Detail |
---|
public CollectNodesVisitor(java.lang.Class nodeClass)
nodeClass
- the class of the node that
we are looking for.public CollectNodesVisitor(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 boolean visitChildrenFirst(Visitable node)
Visitor
visit()
should be called on
the children of node
before it is called on node
itself.
If this method always returns true
, the visitor will walk the
tree bottom-up. If it always returns false
, the tree is visited
top-down.
visitChildrenFirst
in interface Visitor
node
- the top node of a sub-tree about to be visited
true
if node
's children should be visited
before node
, false
otherwisepublic boolean stopTraversal()
Visitor
stopTraversal
in interface Visitor
public Visitable visit(Visitable node)
visit
in interface Visitor
node
- the node to process
public boolean skipChildren(Visitable node)
skipChildren
in interface Visitor
node
- the node to process
public java.util.Vector getList()
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |