|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.derby.impl.sql.execute.SystemAggregator
org.apache.derby.impl.sql.execute.OrderableAggregator
org.apache.derby.impl.sql.execute.MaxMinAggregator
Aggregator for MAX()/MIN(). Defers most of its work to OrderableAggregator.
OrderableAggregator,
Serialized Form| Field Summary | |
private boolean |
isMax
|
protected DataValueDescriptor |
value
|
| Constructor Summary | |
MaxMinAggregator()
|
|
| Method Summary | |
protected void |
accumulate(DataValueDescriptor addend)
Accumulate |
void |
accumulate(DataValueDescriptor addend,
java.lang.Object ga)
Iteratively accumulates the addend into the aggregator. |
boolean |
didEliminateNulls()
Return true if the aggregation eliminated at least one null from the input data set. |
DataValueDescriptor |
getResult()
Return the result of the operations that we have been performing. |
int |
getTypeFormatId()
Get the formatID which corresponds to this class. |
void |
merge(ExecAggregator addend)
Merges one aggregator into a another aggregator. |
ExecAggregator |
newAggregator()
Return a new initialized copy of this aggregator, any state set by the setup() method of the original Aggregator must be copied into the new aggregator. |
void |
readExternal(java.io.ObjectInput in)
|
void |
setup(java.lang.String aggregateName)
Set's up the aggregate for processing. |
void |
writeExternal(java.io.ObjectOutput out)
Although we are not expected to be persistent per se, we may be written out by the sorter temporarily. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private boolean isMax
protected DataValueDescriptor value
| Constructor Detail |
public MaxMinAggregator()
| Method Detail |
public void setup(java.lang.String aggregateName)
ExecAggregator
setup in interface ExecAggregatorsetup in class OrderableAggregator
protected void accumulate(DataValueDescriptor addend)
throws StandardException
accumulate in class SystemAggregatoraddend - value to be added in
StandardException - on errorpublic ExecAggregator newAggregator()
ExecAggregator
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
OrderableAggregatorWhy would we be called to write ourselves out if we are null? For scalar aggregates, we don't bother setting up the aggregator since we only need a single row. So for a scalar aggregate that needs to go to disk, the aggregator might be null.
writeExternal in interface java.io.ExternalizablewriteExternal in class OrderableAggregatorjava.io.IOException - on errorExternalizable.writeExternal(java.io.ObjectOutput)
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.ExternalizablereadExternal in class OrderableAggregatorjava.io.IOException - on error
java.lang.ClassNotFoundException - on errorExternalizable.readExternal(java.io.ObjectInput)public int getTypeFormatId()
public void merge(ExecAggregator addend)
throws StandardException
ExecAggregatorAn example of a merge would be: given two COUNT() aggregators, C1 and C2, a merge of C1 into C2 would set C1.count += C2.count. So, given a CountAggregator with a getCount() method that returns its counts, its merge method might look like this:
public void merge(ExecAggregator inputAggregator) throws StandardException
{
count += ((CountAccgregator)inputAggregator).getCount();
}
addend - the other Aggregator
(input partial aggregate)
StandardException - on errorExecAggregator.merge(org.apache.derby.iapi.sql.execute.ExecAggregator)
public DataValueDescriptor getResult()
throws StandardException
StandardException - on errorpublic boolean didEliminateNulls()
ExecAggregator
didEliminateNulls in interface ExecAggregator
public void accumulate(DataValueDescriptor addend,
java.lang.Object ga)
throws StandardException
ExecAggregator
accumulate in interface ExecAggregatoraddend - the DataValueDescriptor addend (current input to
the aggregation)ga - a result set getter
StandardException - on error
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||