Class StatefulAccumulator<T,O>
java.lang.Object
org.vanted.indexednodes.accumulators.StatefulAccumulator<T,O>
- Type Parameters:
T-O-
- All Implemented Interfaces:
Consumer<O>
- Direct Known Subclasses:
DistanceAccumulator,EdgeCountAccumulator,IndexedEdgeListAccumulator,IndexedNodeSetAccumulator,NodeCountAccumulator
public abstract class StatefulAccumulator<T,O> extends Object implements Consumer<O>
An object that holds an accumulating value of type T and is able to accept
parameters of type O and (potentially) aggregate them into a value of type T.
- Since:
- 2.8
- Author:
- Benjamin Moser
-
Constructor Summary
Constructors Constructor Description StatefulAccumulator(T init) -
Method Summary
Modifier and Type Method Description voidapply(O value)Interface method to apply a value to the accumulator, additionally calling the next accumulator if set.Tget()StatefulAccumulator<T,O>then(StatefulAccumulator<?,O> next)Compose with another accumulator
-
Constructor Details
-
StatefulAccumulator
-
-
Method Details
-
apply
Interface method to apply a value to the accumulator, additionally calling the next accumulator if set.- Parameters:
value-
-
then
Compose with another accumulator- Parameters:
next-- Returns:
-
get
-