Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.sql.compile
Class MaxMinAggregateDefinition  view MaxMinAggregateDefinition download MaxMinAggregateDefinition.java

java.lang.Object
  extended byorg.apache.derby.impl.sql.compile.MaxMinAggregateDefinition
All Implemented Interfaces:
AggregateDefinition

public class MaxMinAggregateDefinition
extends java.lang.Object
implements AggregateDefinition

Defintion for the MAX()/MIN() aggregates.


Field Summary
private  boolean isMax
           
 
Constructor Summary
MaxMinAggregateDefinition()
          Niladic constructor.
 
Method Summary
 org.apache.derby.catalog.TypeDescriptor getAggregator(org.apache.derby.catalog.TypeDescriptor inputType, java.lang.StringBuffer aggregatorClass)
          Determines the result datatype.
 boolean isMax()
          Return if the aggregator class is for min/max.
 void setMaxOrMin(boolean isMax)
          This is set by the parser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isMax

private boolean isMax
Constructor Detail

MaxMinAggregateDefinition

public MaxMinAggregateDefinition()
Niladic constructor. Does nothing. For ease Of use, only.

Method Detail

getAggregator

public final org.apache.derby.catalog.TypeDescriptor getAggregator(org.apache.derby.catalog.TypeDescriptor inputType,
                                                                   java.lang.StringBuffer aggregatorClass)
Determines the result datatype. Accept NumberDataValues only.

Note: In the future you should be able to do a sum user data types. One option would be to run sum on anything that implements divide().

Specified by:
getAggregator in interface AggregateDefinition

setMaxOrMin

public final void setMaxOrMin(boolean isMax)
This is set by the parser.


isMax

public final boolean isMax()
Return if the aggregator class is for min/max.