| Modifier and Type | Field and Description |
|---|---|
| protected DataValueDescriptor |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public DataValueDescriptor | Returns: the result as a DataValueDescriptorImplements org. Return the result of the operations that we have been performing. |
| public void | merge(ExecAggregator
the other Aggregator
(input partial aggregate) addend)Implements org. Merges one aggregator into a another aggregator. |
| public void | readExternal(ObjectInput
the stream to read data from in order to restore the object in)Overrides org. 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. cf, 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. returnDataType)Implements org. Set's up the aggregate for processing. |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| public void | writeExternal(ObjectOutput
the stream to write the object to out)Overrides org. Implements java. Although we are not expected to be persistent per se, we may be written out by the sorter temporarily. |
| value | back to summary |
|---|---|
| protected DataValueDescriptor value | |
| OrderableAggregator | back to summary |
|---|---|
| pack-priv OrderableAggregator() | |
| getResult | back to summary |
|---|---|
| public DataValueDescriptor getResult() throws StandardException Implements org. Return the result of the operations that we have been performing. Returns a DataValueDescriptor.
| |
| 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();
}
| |
| readExternal | back to summary |
|---|---|
| public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException Overrides org. 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 cf, String aggregateName, DataTypeDescriptor returnDataType) Implements org. Doc from org. Set's up the aggregate for processing.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| writeExternal | back to summary |
|---|---|
| public void writeExternal(ObjectOutput out) throws IOException Overrides org. Implements java. Although we are not expected to be persistent per se, we may be written out by the sorter temporarily. So we need to be able to write ourselves out and read ourselves back in. We rely on formatable to handle situations where value is null. Why 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.
| |