Class LongSumOperator

All Implemented Interfaces:
IMultisetAggregationOperator<Long,Long,Long>

public class LongSumOperator extends AbstractMemorylessAggregationOperator<Long,Long>
Incrementally computes the sum of java.lang.Long values
Since:
1.4
  • Field Details

  • Method Details

    • getShortDescription

      public String getShortDescription()
      Description copied from interface: IMultisetAggregationOperator
      A textual description of the operator.
    • getName

      public String getName()
      Description copied from interface: IMultisetAggregationOperator
      A name or identifier of the operator.
    • createNeutral

      public Long createNeutral()
      Returns:
      the neutral element, i.e. the interim result of aggregating an empty multiset.
    • isNeutral

      public boolean isNeutral(Long result)
      Returns:
      true if the interim result is equivalent to the neutral element, as if there are no values in the multiset. Must return true if the multiset is empty.
    • update

      public Long update(Long oldResult, Long updateValue, boolean isInsertion)
      Returns:
      an updated intermediate result, changed to reflect that a given object was added to / removed from the multiset (as indicated by the parameter isInsertion)
    • aggregateStream

      public Long aggregateStream(Stream<Long> stream)
      Description copied from interface: IMultisetAggregationOperator
      Calculates the aggregate results from a given stream of values; all values are considered as inserted
      Returns:
      the aggregate result, or null if no result can be calculated (e.g. because of an empty stream)
      Since:
      2.0