Package com.hazelcast.jet.accumulator
Class PickAnyAccumulator<T>
java.lang.Object
com.hazelcast.jet.accumulator.PickAnyAccumulator<T>
- Type Parameters:
T
-
public class PickAnyAccumulator<T> extends Object
Keeps the state needed to implement the
AggregateOperations.pickAny()
aggregate operation. It maintains the
count of accumulated items so that it can properly set its value to
null
when all the items are deducted.- Since:
- 4.5
-
Constructor Summary
Constructors Constructor Description PickAnyAccumulator()
Constructs an emptypickAny
accumulator.PickAnyAccumulator(T value, long count)
Constructs apickAny
accumulator with the full state passed in the parameters. -
Method Summary
Modifier and Type Method Description void
accumulate(T t)
Accumulates an item.void
combine(PickAnyAccumulator<T> other)
Combines another accumulator with this one.long
count()
Returns the count of accumulated objects.void
deduct(PickAnyAccumulator<T> other)
Deducts another accumulator from this one.boolean
equals(Object o)
T
get()
Returns the picked object.int
hashCode()
String
toString()
-
Constructor Details
-
PickAnyAccumulator
public PickAnyAccumulator()Constructs an emptypickAny
accumulator. -
PickAnyAccumulator
Constructs apickAny
accumulator with the full state passed in the parameters.- Parameters:
value
- the picked objectcount
- the count of accumulated objects
-
-
Method Details