Package com.gengoai.stream.local
Class LocalMListAccumulator<E>
- java.lang.Object
-
- com.gengoai.stream.local.LocalMAccumulator<E,List<E>>
-
- com.gengoai.stream.local.LocalMListAccumulator<E>
-
- Type Parameters:
E
- the component type parameter of the list
- All Implemented Interfaces:
Copyable<LocalMAccumulator<E,List<E>>>
,MAccumulator<E,List<E>>
,Serializable
public class LocalMListAccumulator<E> extends LocalMAccumulator<E,List<E>>
An implementation of a
MAccumulator
that accumulates values in lists for local streams- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LocalMListAccumulator(String name)
Instantiates a new LocalMListAccumulator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(E e)
Adds an item to the accumulatorLocalMAccumulator<E,List<E>>
copy()
Makes a copy of this object.boolean
isZero()
Determines if the accumulator is a zero valuevoid
merge(MAccumulator<E,List<E>> other)
Merges another accumulator with this onevoid
reset()
Resets the accumulator to its zero-value.List<E>
value()
The value of the accumulator.-
Methods inherited from class com.gengoai.stream.local.LocalMAccumulator
name, register, report
-
-
-
-
Constructor Detail
-
LocalMListAccumulator
public LocalMListAccumulator(String name)
Instantiates a new LocalMListAccumulator.- Parameters:
name
- the name of the accumulator
-
-
Method Detail
-
add
public void add(E e)
Description copied from interface:MAccumulator
Adds an item to the accumulator- Parameters:
e
- the item to add
-
merge
public void merge(MAccumulator<E,List<E>> other)
Description copied from interface:MAccumulator
Merges another accumulator with this one- Parameters:
other
- the other accumulator to merge
-
reset
public void reset()
Description copied from interface:MAccumulator
Resets the accumulator to its zero-value.
-
value
public List<E> value()
Description copied from interface:MAccumulator
The value of the accumulator.- Returns:
- the result of the accumulator
-
isZero
public boolean isZero()
Description copied from interface:MAccumulator
Determines if the accumulator is a zero value- Returns:
- True if the accumulator is in a zero state
-
copy
public LocalMAccumulator<E,List<E>> copy()
Description copied from interface:Copyable
Makes a copy of this object.
- Returns:
- A copy of this object.
-
-