| Modifier and Type | Field and Description |
|---|---|
| private Aggregator | |
| private boolean | |
| private DataTypeDescriptor | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | accumulate(DataValueDescriptor
the DataValueDescriptor addend (current input to
the aggregation) addend, Object a result set getter ga)Implements org. Iteratively accumulates the addend into the aggregator. |
| public boolean | didEliminateNulls()
Implements org. Return true if the aggregation eliminated at least one null from the input data set. |
| public DataValueDescriptor | Returns: the aggregated result (could be a Java null).Implements org. Return the result of the aggregation. |
| public int | Returns: the formatID of this classImplements org. Get the formatID which corresponds to this class. |
| private void | logAggregatorInstantiationError(String aggregateName, Throwable t)
Record an instantiation error trying to load the aggregator class. |
| public void | merge(ExecAggregator
the other Aggregator
(input partial aggregate) addend)Implements org. Merges one aggregator into a another aggregator. |
| public ExecAggregator | newAggregator()
Implements org. 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. |
| public void | readExternal(ObjectInput
the stream to read data from in order to restore the object in)Implements java. The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
| public void | setup(ClassFactory
Database-specific class factory. classFactory, String For builtin aggregates, this is a SQL aggregate name like MAX. For user-defined aggregates, this is the name of the user-written class which implements org.apache.derby.agg.Aggregator. aggregateName, DataTypeDescriptor The type returned by the getResult() method. resultType)Implements org. Set's up the aggregate for processing. |
| private void | setup(Class<?> udaClass, DataTypeDescriptor resultType)
Initialization logic shared by setup() and newAggregator() |
| public void | writeExternal(ObjectOutput
the stream to write the object to out)Implements java. The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays. |
| _aggregator | back to summary |
|---|---|
| private Aggregator<V, R, A extends Aggregator<V, R, A>> _aggregator | |
| _eliminatedNulls | back to summary |
|---|---|
| private boolean _eliminatedNulls | |
| _resultType | back to summary |
|---|---|
| private DataTypeDescriptor _resultType | |
| FIRST_VERSION | back to summary |
|---|---|
| private static final int FIRST_VERSION | |
| UserDefinedAggregator | back to summary |
|---|---|
| public UserDefinedAggregator() 0-arg constructor for Formatable interface | |
| accumulate | back to summary |
|---|---|
| public void accumulate(DataValueDescriptor addend, Object ga) throws StandardException Implements org. Doc from org. Iteratively accumulates the addend into the aggregator. Called on each member of the set of values that is being aggregated.
| |
| didEliminateNulls | back to summary |
|---|---|
| public boolean didEliminateNulls() Implements org. Doc from org. Return true if the aggregation eliminated at least one null from the input data set. | |
| getResult | back to summary |
|---|---|
| public DataValueDescriptor getResult() throws StandardException Implements org. Return the result of the aggregation. .
| |
| getTypeFormatId | back to summary |
|---|---|
| public int getTypeFormatId() Implements org. Get the formatID which corresponds to this class.
| |
| logAggregatorInstantiationError | back to summary |
|---|---|
| private void logAggregatorInstantiationError(String aggregateName, Throwable t) Record an instantiation error trying to load the aggregator class. | |
| merge | back to summary |
|---|---|
| public void merge(ExecAggregator addend) throws StandardException Implements org. Doc from org. Merges one aggregator into a another aggregator. Merges two partial aggregates results into a single result. Needed for:
An 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();
}
| |
| newAggregator | back to summary |
|---|---|
| public ExecAggregator newAggregator() Implements org. Doc from org. 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.
| |
| readExternal | back to summary |
|---|---|
| public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException Implements java. Doc from java. The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.
| |
| setup | back to summary |
|---|---|
| public void setup(ClassFactory classFactory, String aggregateName, DataTypeDescriptor resultType) Implements org. Doc from org. Set's up the aggregate for processing.
| |
| setup | back to summary |
|---|---|
| private void setup(Class<?> udaClass, DataTypeDescriptor resultType) Initialization logic shared by setup() and newAggregator() | |
| writeExternal | back to summary |
|---|---|
| public void writeExternal(ObjectOutput out) throws IOException Implements java. Doc from java. The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
| |