Class SumOperator<T extends java.lang.Number>

  • Type Parameters:
    T - type of the incoming items, must be a Number.
    All Implemented Interfaces:
    java.util.function.Function<Multi<T>,​Multi<java.lang.Double>>

    public class SumOperator<T extends java.lang.Number>
    extends java.lang.Object
    implements java.util.function.Function<Multi<T>,​Multi<java.lang.Double>>
    Sum operator emitting the current sum of the item emitted by the upstream. Everytime it gets an item from upstream, it emits the sum of the previous elements If the stream emits the completion event without having emitting any item before, 0 is emitted, followed by the completion event. If the upstream emits a failure, the failure is propagated.
    • Constructor Summary

      Constructors 
      Constructor Description
      SumOperator()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Multi<java.lang.Double> apply​(Multi<T> multi)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Function

        andThen, compose
    • Constructor Detail

      • SumOperator

        public SumOperator()
    • Method Detail

      • apply

        public Multi<java.lang.Double> apply​(Multi<T> multi)
        Specified by:
        apply in interface java.util.function.Function<Multi<T extends java.lang.Number>,​Multi<java.lang.Double>>