Interface MAccumulator<IN,​OUT>

    • Method Detail

      • add

        void add​(IN in)
        Adds an item to the accumulator
        Parameters:
        in - the item to add
      • name

        Optional<String> name()
        The name of the accumulator
        Returns:
        the optional name of the accumulator
      • reset

        void reset()
        Resets the accumulator to its zero-value.
      • value

        OUT value()
        The value of the accumulator.
        Returns:
        the result of the accumulator
      • isZero

        boolean isZero()
        Determines if the accumulator is a zero value
        Returns:
        True if the accumulator is in a zero state
      • register

        void register()
        Registers the accumulator.
      • report

        default void report​(SerializablePredicate<? super OUT> when,
                            Consumer<OUT> message)
        Reports the given message when the given predicate evaluates to true.
        Parameters:
        when - the predicate controlling when the message should be performed
        message - a consumer processing the current value of the accumulator