Visitor
class BaseTableNumbersVisitor extends java.lang.Object implements Visitor
Modifier and Type | Field | Description |
---|---|---|
private int |
columnNumber |
|
private JBitSet |
tableMap |
Constructor | Description |
---|---|
BaseTableNumbersVisitor(JBitSet tableMap) |
Constructor: takes a JBitSet to use as the holder for any base table
numbers found while walking the subtree.
|
Modifier and Type | Method | Description |
---|---|---|
protected int |
getColumnNumber() |
Retrieve the the position of the ColumnReference or
ResultColumn for which we most recently found a base
table number.
|
protected void |
reset() |
Reset the state of this visitor.
|
protected void |
setTableMap(JBitSet tableMap) |
Set a new JBitSet to serve as the holder for base table numbers
we find while walking.
|
boolean |
skipChildren(Visitable node) |
Method that is called to indicate whether
we should skip all nodes below this node
for traversal.
|
boolean |
stopTraversal() |
Method that is called to see
if query tree traversal should be
stopped before visiting all nodes.
|
Visitable |
visit(Visitable node) |
This is the default visit operation on a
QueryTreeNode.
|
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. |
private JBitSet tableMap
private int columnNumber
BaseTableNumbersVisitor(JBitSet tableMap)
tableMap
- JBitSet into which we put the table numbers we find.protected void setTableMap(JBitSet tableMap)
tableMap
- JBitSet into which we put the table numbers we find.protected void reset()
protected int getColumnNumber()
public Visitable visit(Visitable node) throws StandardException
Visitor
Visitors will overload this method by implementing a version with a signature that matches a specific type of node. For example, if I want to do something special with aggregate nodes, then that Visitor will implement a visit(AggregateNode node) method which does the aggregate specific processing.
visit
in interface Visitor
node
- the node to processStandardException
- may be throw an error
as needed by the visitor (i.e. may be a normal error
if a particular node is found, e.g. if checking
a group by, we don't expect to find any ColumnReferences
that aren't under an AggregateNode -- the easiest
thing to do is just throw an error when we find the
questionable node).Visitor.visit(org.apache.derby.iapi.sql.compile.Visitable)
public boolean skipChildren(Visitable node)
Visitor
Differs from stopTraversal() in that it only affects subtrees, rather than the entire traversal.
skipChildren
in interface Visitor
node
- the node to processVisitor.skipChildren(org.apache.derby.iapi.sql.compile.Visitable)
public boolean stopTraversal()
Visitor
stopTraversal
in interface Visitor
Visitor.stopTraversal()
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 visitedtrue
if node
's children should be visited
before node
, false
otherwiseVisitor.visitChildrenFirst(org.apache.derby.iapi.sql.compile.Visitable)
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.