org.apache.derby.agg
Interface Aggregator<V,R,A extends Aggregator<V,R,A>>

All Superinterfaces:
java.io.Serializable

public interface Aggregator<V,R,A extends Aggregator<V,R,A>>
extends java.io.Serializable

Behavior of a user-defined Derby aggregator. Aggregates values of type V and returns a result of type R. In addition to the methods in the interface, implementing classes must have a 0-arg public constructor.


Method Summary
 void accumulate(V value)
          Accumulate the next scalar value
 void init()
          Initialize the Aggregator
 void merge(A otherAggregator)
          For merging another partial result into this Aggregator.
 R terminate()
          Return the result scalar value
 

Method Detail

init

void init()
Initialize the Aggregator


accumulate

void accumulate(V value)
Accumulate the next scalar value


merge

void merge(A otherAggregator)
For merging another partial result into this Aggregator. This lets the SQL interpreter divide the incoming rows into subsets, aggregating each subset in isolation, and then merging the partial results together.


terminate

R terminate()
Return the result scalar value


Built on Wed 2013-06-12 15:21:56+0000, from revision ???

Apache Derby V10.10 Internals - Copyright © 2004,2013 The Apache Software Foundation. All Rights Reserved.