Package com.gengoai.stream.local
Class LocalMAccumulator<IN,OUT>
- java.lang.Object
-
- com.gengoai.stream.local.LocalMAccumulator<IN,OUT>
-
- Type Parameters:
IN
- the type parameter for what is being accumulatedOUT
- the type parameter for the result of the accumulation
- All Implemented Interfaces:
Copyable<LocalMAccumulator<IN,OUT>>
,MAccumulator<IN,OUT>
,Serializable
- Direct Known Subclasses:
LocalMCounterAccumulator
,LocalMDoubleAccumulator
,LocalMListAccumulator
,LocalMLongAccumulator
,LocalMMapAccumulator
,LocalMMultiCounterAccumulator
,LocalMSetAccumulator
,LocalMStatisticsAccumulator
public abstract class LocalMAccumulator<IN,OUT> extends Object implements MAccumulator<IN,OUT>, Copyable<LocalMAccumulator<IN,OUT>>
Abstract base for local accumulators.
- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LocalMAccumulator(String name)
Instantiates a new Local m accumulator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
name()
The name of the accumulatorvoid
register()
Registers the accumulator.void
report(SerializablePredicate<? super OUT> when, Consumer<OUT> message)
Reports the given message when the given predicate evaluates to true.
-
-
-
Constructor Detail
-
LocalMAccumulator
protected LocalMAccumulator(String name)
Instantiates a new Local m accumulator.- Parameters:
name
- the name of the accumulator (null is ok)
-
-
Method Detail
-
name
public final Optional<String> name()
Description copied from interface:MAccumulator
The name of the accumulator- Specified by:
name
in interfaceMAccumulator<IN,OUT>
- Returns:
- the optional name of the accumulator
-
register
public void register()
Description copied from interface:MAccumulator
Registers the accumulator.- Specified by:
register
in interfaceMAccumulator<IN,OUT>
-
report
public void report(SerializablePredicate<? super OUT> when, Consumer<OUT> message)
Description copied from interface:MAccumulator
Reports the given message when the given predicate evaluates to true.- Specified by:
report
in interfaceMAccumulator<IN,OUT>
- Parameters:
when
- the predicate controlling when the message should be performedmessage
- a consumer processing the current value of the accumulator
-
-