Interface Aggregator


  • public interface Aggregator
    Interface to be implemented by implementations of aggregations; consumers of the API should generally not need to implement this interface.
    • 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 to setInputs(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 by getInternalTypes().
      • 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 by getInternalTypes().
      • updateInternals

        void updateInternals​(ReadableStorage readView,
                             WriteableStorage writeView)
        Updates an existing internals object with new values. Most implementations will simply call storeInternals(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 counters
        writeView - 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.