Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

pack-priv Class ReplaceAggregatesWithCRVisitor

extends Object
implements Visitor
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.compile.Visitor
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.compile.Visitable, .Visitor

Replace all aggregates with result columns.

Field Summary

Modifier and TypeField and Description
private ResultColumnList
private Class<?>
private int

Constructor Summary

AccessConstructor and Description
pack-priv
ReplaceAggregatesWithCRVisitor(ResultColumnList
the result column list
rcl
,
int
The tableNumber for the new CRs
tableNumber
)

Replace all aggregates with column references.

pack-priv
ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, int tableNumber, Class<?> skipOverClass)

pack-priv
ReplaceAggregatesWithCRVisitor(ResultColumnList
the result column list
rcl
,
Class<?>
don't examine anything below nodeToSkip
nodeToSkip
)

Replace all aggregates with column references.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true/false
skipChildren
(Visitable
the node to process
node
)

Implements org.apache.derby.iapi.sql.compile.Visitor.skipChildren.

Don't visit children under the skipOverClass node, if it isn't null.

public boolean
stopTraversal()

Implements org.apache.derby.iapi.sql.compile.Visitor.stopTraversal.

Method that is called to see if query tree traversal should be stopped before visiting all nodes.

public Visitable

Returns:

me
visit
(Visitable
the node to process
node
)

Implements org.apache.derby.iapi.sql.compile.Visitor.visit.

Don't do anything unless we have an aggregate node.

public boolean
visitChildrenFirst(Visitable
the top node of a sub-tree about to be visited
node
)

Implements org.apache.derby.iapi.sql.compile.Visitor.visitChildrenFirst.

Method that is called to see if visit() should be called on the children of node before it is called on node itself.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rclback to summary
private ResultColumnList rcl
skipOverClassback to summary
private Class<?> skipOverClass
tableNumberback to summary
private int tableNumber

Constructor Detail

ReplaceAggregatesWithCRVisitorback to summary
pack-priv 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:ResultColumnList

the result column list

tableNumber:int

The tableNumber for the new CRs

ReplaceAggregatesWithCRVisitorback to summary
pack-priv ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, int tableNumber, Class<?> skipOverClass)
ReplaceAggregatesWithCRVisitorback to summary
pack-priv ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, 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:ResultColumnList

the result column list

nodeToSkip:Class<?>

don't examine anything below nodeToSkip

Method Detail

skipChildrenback to summary
public boolean skipChildren(Visitable node)

Implements org.apache.derby.iapi.sql.compile.Visitor.skipChildren.

Don't visit children under the skipOverClass node, if it isn't null.

Parameters
node:Visitable

Doc from org.apache.derby.iapi.sql.compile.Visitor.skipChildren.

the node to process

Returns:boolean

true/false

stopTraversalback to summary
public boolean stopTraversal()

Implements org.apache.derby.iapi.sql.compile.Visitor.stopTraversal.

Doc from org.apache.derby.iapi.sql.compile.Visitor.stopTraversal.

Method 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.

Returns:boolean

true/false

visitback to summary
public Visitable visit(Visitable node) throws StandardException

Implements org.apache.derby.iapi.sql.compile.Visitor.visit.

Don't do anything unless we have an aggregate node.

Parameters
node:Visitable

the node to process

Returns:Visitable

me

Exceptions
StandardException:
on error
visitChildrenFirstback to summary
public boolean visitChildrenFirst(Visitable node)

Implements org.apache.derby.iapi.sql.compile.Visitor.visitChildrenFirst.

Doc from org.apache.derby.iapi.sql.compile.Visitor.visitChildrenFirst.

Method that is called to see if 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.

Parameters
node:Visitable

the top node of a sub-tree about to be visited

Returns:boolean

true if node's children should be visited before node, false otherwise