-
public interface Aggregator
Interface to be implemented by implementations of aggregations; consumers of the API should generally not need to implement this interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
accumulate()
Adds the current row to the internal counters.void
combineInternals(ReadableStorage internals)
Adds the internal counters of another aggregator this this aggregator's internal counters.ScalarTokenType[]
getInternalTypes()
Returns the types of the internal counters of this aggregatorScalarTokenType
getOutputType()
Returns the output type of this aggregator.void
reset()
Resets the internal countersvoid
setInputs(ScalarValued[] inputs)
Binds the input values for this aggregator.void
storeFinalResult(ScalarSettable output)
Outputs the final result into the specified ScalarSettable.void
storeInternals(WriteableStorage internals)
Stores the internal counters of this aggregator.void
updateInternals(ReadableStorage readView, WriteableStorage writeView)
Updates an existing internals object with new values.
-
-
-
Method Detail
-
setInputs
void setInputs(ScalarValued[] inputs)
Binds the input values for this aggregator.- Parameters:
inputs
- the sources of values to aggregate
-
accumulate
void accumulate()
Adds the current row to the internal counters. The values of the current row are available from the previous call tosetInputs(ScalarValued[])
.
-
reset
void reset()
Resets the internal counters
-
getInternalTypes
ScalarTokenType[] getInternalTypes()
Returns the types of the internal counters of this aggregator- Returns:
- the types of the internal counters of this aggregator
-
combineInternals
void combineInternals(ReadableStorage internals)
Adds the internal counters of another aggregator this this aggregator's internal counters.- Parameters:
internals
- the internal counters of the other aggregator. Will match the types returned bygetInternalTypes()
.
-
storeInternals
void storeInternals(WriteableStorage internals)
Stores the internal counters of this aggregator.- Parameters:
internals
- Storage in which to store this aggregators internals. Will match the types returned bygetInternalTypes()
.
-
updateInternals
void updateInternals(ReadableStorage readView, WriteableStorage writeView)
Updates an existing internals object with new values. Most implementations will simply callstoreInternals(WriteableStorage)
as this is always safe. For GC efficiency, implementations that have mutable components may wish to copy over those existing components rather than cloning.- Parameters:
readView
- storage to use for loading internal counterswriteView
- storage to use for storage internal counters
-
storeFinalResult
void storeFinalResult(ScalarSettable output)
Outputs the final result into the specified ScalarSettable.- Parameters:
output
- the output where the result is to be stored
-
getOutputType
ScalarTokenType getOutputType()
Returns the output type of this aggregator.- Returns:
- the output type of this aggregator.
-
-