org.apache.derby.impl.sql.compile
Class GroupByNode.ExpressionSorter

java.lang.Object
  extended by org.apache.derby.impl.sql.compile.GroupByNode.ExpressionSorter
All Implemented Interfaces:
java.util.Comparator
Enclosing class:
GroupByNode

private static final class GroupByNode.ExpressionSorter
extends java.lang.Object
implements java.util.Comparator

Comparator class for GROUP BY expression substitution. This class enables the sorting of a collection of SubstituteExpressionVisitor instances. We sort the visitors during the tree manipulation processing in order to process expressions of higher complexity prior to expressions of lower complexity. Processing the expressions in this order ensures that we choose the best match for an expression, and thus avoids problems where we substitute a sub-expression instead of the full expression. For example, if the statement is: ... GROUP BY a+b, a, a*(a+b), a+b+c we'll process those expressions in the order: a*(a+b), a+b+c, a+b, then a.


Constructor Summary
private GroupByNode.ExpressionSorter()
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

GroupByNode.ExpressionSorter

private GroupByNode.ExpressionSorter()
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.