| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | accumulate(DataValueDescriptor
value to be added in addend, Object the generic aggregator that is calling me ga)Overrides org. Implements org. Accumulate for count(). |
| protected final void | accumulate(DataValueDescriptor addend)
Implements abstract org.
|
| public DataValueDescriptor | Returns: the value as a LongImplements org. Return the result of the aggregation. |
| public int | Returns: the formatID of this classImplements org. Get the formatID which corresponds to this class. |
| public boolean | |
| public void | merge(ExecAggregator
the other Aggregator
(input partial aggregate) addend)Implements org. Merges one aggregator into a another aggregator. |
| public ExecAggregator | Returns: ExecAggregator the new aggregatorImplements 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 final 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. returnType)Implements org. Set's up the aggregate for processing. |
| public final 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. |
| isCountStar | back to summary |
|---|---|
| private boolean isCountStar | |
| value | back to summary |
|---|---|
| private long value | |
| CountAggregator | back to summary |
|---|---|
| public CountAggregator() | |
| accumulate | back to summary |
|---|---|
| public void accumulate(DataValueDescriptor addend, Object ga) throws StandardException Overrides org. Implements org. Accumulate for count(). Toss out all nulls in this kind of count. Increment the count for count(*). Count even the null values.
| |
| accumulate | back to summary |
|---|---|
| protected final void accumulate(DataValueDescriptor addend) Implements abstract org. | |
| getResult | back to summary |
|---|---|
| public DataValueDescriptor getResult() Implements org. Return the result of the aggregation. Just spit out the running count.
| |
| getTypeFormatId | back to summary |
|---|---|
| public int getTypeFormatId() Implements org. Get the formatID which corresponds to this class.
| |
| isCountStar | back to summary |
|---|---|
| public boolean isCountStar() | |
| 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 final 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 returnType) Implements org. Doc from org. Set's up the aggregate for processing.
| |
| writeExternal | back to summary |
|---|---|
| public final 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.
| |