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 Details

    • PickAnyAccumulator

      public PickAnyAccumulator()
      Constructs an empty pickAny accumulator.
    • PickAnyAccumulator

      public PickAnyAccumulator​(T value, long count)
      Constructs a pickAny accumulator with the full state passed in the parameters.
      Parameters:
      value - the picked object
      count - the count of accumulated objects
  • Method Details

    • accumulate

      public void accumulate​(@Nullable T t)
      Accumulates an item.
    • combine

      public void combine​(@Nonnull PickAnyAccumulator<T> other)
      Combines another accumulator with this one.
    • deduct

      public void deduct​(@Nonnull PickAnyAccumulator<T> other)
      Deducts another accumulator from this one.
    • get

      public T get()
      Returns the picked object.
    • count

      public long count()
      Returns the count of accumulated objects.
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object