org.apache.derby.impl.sql.compile
Class ReplaceAggregatesWithCRVisitor

java.lang.Object
  extended byorg.apache.derby.impl.sql.compile.ReplaceAggregatesWithCRVisitor
All Implemented Interfaces:
Visitor

public class ReplaceAggregatesWithCRVisitor
extends java.lang.Object
implements Visitor

Replace all aggregates with result columns.

Author:
jamie

Field Summary
private  ResultColumnList rcl
           
private  java.lang.Class skipOverClass
           
private  int tableNumber
           
 
Constructor Summary
ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, java.lang.Class nodeToSkip)
          Replace all aggregates with column references.
ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, int tableNumber)
          Replace all aggregates with column references.
 
Method Summary
 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)
          Don't do anything unless we have an aggregate node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rcl

private ResultColumnList rcl

skipOverClass

private java.lang.Class skipOverClass

tableNumber

private int tableNumber
Constructor Detail

ReplaceAggregatesWithCRVisitor

public 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 list
tableNumber - The tableNumber for the new CRs

ReplaceAggregatesWithCRVisitor

public 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 list
nodeToSkip - 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:
visit in interface Visitor
Parameters:
node - the node to process
Returns:
me
Throws:
StandardException - on error

skipChildren

public boolean skipChildren(Visitable node)
Don't visit childen under the skipOverClass node, if it isn't null.

Specified by:
skipChildren in interface Visitor
Parameters:
node - the node to process
Returns:
true/false

stopTraversal

public boolean stopTraversal()
Description copied from interface: Visitor
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.

Specified by:
stopTraversal in interface Visitor
Returns:
true/false

Built on Mon 2007-06-04 09:58:47+0400, from revision ???

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.