org.apache.derby.impl.sql.compile
Class GroupByNode.ExpressionSorter
java.lang.Object
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.
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 |
GroupByNode.ExpressionSorter
private GroupByNode.ExpressionSorter()
compare
public int compare(java.lang.Object o1,
java.lang.Object o2)
- Specified by:
compare
in interface java.util.Comparator
Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.