- Type Parameters:
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
nullwhen all the items are deducted.
Modifier and Type Method Description
accumulate(T t)Accumulates an item.
combine(PickAnyAccumulator<T> other)Combines another accumulator with this one.
count()Returns the count of accumulated objects.
deduct(PickAnyAccumulator<T> other)Deducts another accumulator from this one.
get()Returns the picked object.
public PickAnyAccumulator()Constructs an empty
public PickAnyAccumulator(T value, long count)Constructs a
pickAnyaccumulator with the full state passed in the parameters.
value- the picked object
count- the count of accumulated objects
Accumulates an item.
Combines another accumulator with this one.
Deducts another accumulator from this one.
public T get()Returns the picked object.
public long count()Returns the count of accumulated objects.
public boolean equals(Object o)
public int hashCode()
public String toString()