public class CollectionAccumulator<T> extends AccumulatorV2<T,java.util.List<T>>
accumulator
for collecting a list of elements.
Constructor and Description |
---|
CollectionAccumulator() |
Modifier and Type | Method and Description |
---|---|
void |
add(T v)
Takes the inputs and accumulates.
|
CollectionAccumulator<T> |
copy()
Creates a new copy of this accumulator.
|
CollectionAccumulator<T> |
copyAndReset()
Creates a new copy of this accumulator, which is zero value.
|
boolean |
isZero()
Returns if this accumulator is zero value or not.
|
void |
merge(AccumulatorV2<T,java.util.List<T>> other)
Merges another same-type accumulator into this one and update its state, i.e.
|
void |
reset()
Resets this accumulator, which is zero value.
|
java.util.List<T> |
value()
Defines the current value of this accumulator
|
id, isRegistered, name, toString
public boolean isZero()
AccumulatorV2
isZero
in class AccumulatorV2<T,java.util.List<T>>
public CollectionAccumulator<T> copyAndReset()
AccumulatorV2
isZero
on the copy
must return true.copyAndReset
in class AccumulatorV2<T,java.util.List<T>>
public CollectionAccumulator<T> copy()
AccumulatorV2
copy
in class AccumulatorV2<T,java.util.List<T>>
public void reset()
AccumulatorV2
isZero
must
return true.reset
in class AccumulatorV2<T,java.util.List<T>>
public void add(T v)
AccumulatorV2
add
in class AccumulatorV2<T,java.util.List<T>>
v
- (undocumented)public void merge(AccumulatorV2<T,java.util.List<T>> other)
AccumulatorV2
merge
in class AccumulatorV2<T,java.util.List<T>>
other
- (undocumented)public java.util.List<T> value()
AccumulatorV2
value
in class AccumulatorV2<T,java.util.List<T>>