Class ReplaceAggregatesWithCRVisitor
- java.lang.Object
-
- org.apache.derby.impl.sql.compile.ReplaceAggregatesWithCRVisitor
-
-
Field Summary
Fields Modifier and Type Field Description private ResultColumnListrclprivate java.lang.Class<?>skipOverClassprivate inttableNumber
-
Constructor Summary
Constructors Constructor Description ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, int tableNumber)Replace all aggregates with column references.ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, int tableNumber, java.lang.Class<?> skipOverClass)ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, java.lang.Class<?> nodeToSkip)Replace all aggregates with column references.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanskipChildren(Visitable node)Don't visit children under the skipOverClass node, if it isn't null.booleanstopTraversal()Method that is called to see if query tree traversal should be stopped before visiting all nodes.Visitablevisit(Visitable node)Don't do anything unless we have an aggregate node.booleanvisitChildrenFirst(Visitable node)Method that is called to see ifvisit()should be called on the children ofnodebefore it is called onnodeitself.
-
-
-
Field Detail
-
rcl
private ResultColumnList rcl
-
skipOverClass
private java.lang.Class<?> skipOverClass
-
tableNumber
private int tableNumber
-
-
Constructor Detail
-
ReplaceAggregatesWithCRVisitor
ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, int tableNumber)
Replace all aggregates with column references. Add the reference to the RCL. Delegates most work to AggregateNode.replaceAggregatesWithColumnReferences(rcl, tableNumber).- Parameters:
rcl- the result column listtableNumber- The tableNumber for the new CRs
-
ReplaceAggregatesWithCRVisitor
ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, int tableNumber, java.lang.Class<?> skipOverClass)
-
ReplaceAggregatesWithCRVisitor
ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, java.lang.Class<?> nodeToSkip)
Replace all aggregates with column references. Add the reference to the RCL. Delegates most work to AggregateNode.replaceAggregatesWithColumnReferences(rcl). Doesn't traverse below the passed in class.- Parameters:
rcl- the result column listnodeToSkip- don't examine anything below nodeToSkip
-
-
Method Detail
-
visit
public Visitable visit(Visitable node) throws StandardException
Don't do anything unless we have an aggregate node.- Specified by:
visitin interfaceVisitor- Parameters:
node- the node to process- Returns:
- me
- Throws:
StandardException- on error
-
skipChildren
public boolean skipChildren(Visitable node)
Don't visit children under the skipOverClass node, if it isn't null.- Specified by:
skipChildrenin interfaceVisitor- Parameters:
node- the node to process- Returns:
- true/false
-
visitChildrenFirst
public boolean visitChildrenFirst(Visitable node)
Description copied from interface:VisitorMethod that is called to see ifvisit()should be called on the children ofnodebefore it is called onnodeitself. If this method always returnstrue, the visitor will walk the tree bottom-up. If it always returnsfalse, the tree is visited top-down.- Specified by:
visitChildrenFirstin interfaceVisitor- Parameters:
node- the top node of a sub-tree about to be visited- Returns:
trueifnode's children should be visited beforenode,falseotherwise
-
stopTraversal
public boolean stopTraversal()
Description copied from interface:VisitorMethod that is called to see if query tree traversal should be stopped before visiting all nodes. Useful for short circuiting traversal if we already know we are done.- Specified by:
stopTraversalin interfaceVisitor- Returns:
- true/false
-
-