|
|||||||||
| 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 list.
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.List |
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.List |
getList()
Return the list of matching nodes. |
boolean |
skipChildren(Visitable node)
Don't visit children 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 final java.util.List nodeList
private final java.lang.Class nodeClass
private final 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)
Visitorvisit() 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 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 stopTraversal()
Visitor
stopTraversal in interface Visitorpublic Visitable visit(Visitable node)
visit in interface Visitornode - the node to process
public boolean skipChildren(Visitable node)
skipChildren in interface Visitornode - the node to process
public java.util.List getList()
null.
|
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 | ||||||||