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 java.lang.Object
Keeps the state needed to implement theAggregateOperations.pickAny()
aggregate operation. It maintains the count of accumulated items so that it can properly set its value tonull
when all the items are deducted.- Since:
- Jet 4.5
-
-
Constructor Summary
Constructors Constructor Description PickAnyAccumulator()
Constructs an emptypickAny
accumulator.PickAnyAccumulator(T value)
Constructs apickAny
accumulator with the full state passed in the parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accumulate(T t)
Accumulates an item.void
combine(PickAnyAccumulator<T> other)
Combines another accumulator with this one.boolean
equals(java.lang.Object o)
T
get()
Returns the picked object.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
PickAnyAccumulator
public PickAnyAccumulator()
Constructs an emptypickAny
accumulator.
-
PickAnyAccumulator
public PickAnyAccumulator(T value)
Constructs apickAny
accumulator with the full state passed in the parameters.- Parameters:
value
- the picked object
-
-
Method Detail
-
accumulate
public void accumulate(@Nullable T t)
Accumulates an item.
-
combine
public void combine(@Nonnull PickAnyAccumulator<T> other)
Combines another accumulator with this one.
-
get
public T get()
Returns the picked object.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-