Package uk.ac.starlink.table.join
Interface CollectionRunner.ElementCollector<E,A>
- Enclosing class:
CollectionRunner<E>
public static interface CollectionRunner.ElementCollector<E,A>
Interface to define a collection operation for use with this class.
It resembles
SplitCollector
,
but does not subclass it, since the elements it accumulates are
not Splittables.-
Method Summary
Modifier and TypeMethodDescriptionvoid
accumulate
(E element, A accumulator) Consumes an element, accumulating it into the supplied accumulator.Combines the content of two accumulators.Returns a new accumulator into which results can be collected.
-
Method Details
-
createAccumulator
A createAccumulator()Returns a new accumulator into which results can be collected. Accumulator instances may only be used from one thread at any one time.- Returns:
- new accumulator
-
accumulate
Consumes an element, accumulating it into the supplied accumulator.- Parameters:
element
- object to accumulateaccumulator
- accumulator
-
combine
Combines the content of two accumulators. The returned value may or may not be the same object as one of the input values. The input values should not be used following this call. The sequence of the input values is not significant.- Parameters:
acc1
- one input accumulatoracc2
- other input accumulator- Returns:
- accumulator containing the combined result of the inputs
-