Aggregates a collection by calling the aggregation function on every element of the collection while running through the collection with an iterator.
Aggregates a collection by calling the aggregation function on every element of the collection while running through the collection with an iterator.The application context supplied is passed to the aggregation function for each element.
If the aggregation function for an element returns a value > 0, the aggregation is terminated immediately and the return value of the aggregation function is given back to the caller.
Otherwise the aggregation is continued to the next element of the collection until the iterator reaches its end.
This method has a time complexity of O(N), with N being the size of the collection.