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 false if this accumulator instance has any values in it.
|
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, toStringpublic void add(T v)
AccumulatorV2add in class AccumulatorV2<T,java.util.List<T>>v - (undocumented)public CollectionAccumulator<T> copy()
AccumulatorV2copy in class AccumulatorV2<T,java.util.List<T>>public CollectionAccumulator<T> copyAndReset()
AccumulatorV2isZero on the copy
must return true.copyAndReset in class AccumulatorV2<T,java.util.List<T>>public boolean isZero()
isZero in class AccumulatorV2<T,java.util.List<T>>public void merge(AccumulatorV2<T,java.util.List<T>> other)
AccumulatorV2merge in class AccumulatorV2<T,java.util.List<T>>other - (undocumented)public void reset()
AccumulatorV2isZero must
return true.reset in class AccumulatorV2<T,java.util.List<T>>public java.util.List<T> value()
AccumulatorV2value in class AccumulatorV2<T,java.util.List<T>>