Class BinListCollector
java.lang.Object
uk.ac.starlink.ttools.plot2.layer.BinListCollector
- All Implemented Interfaces:
uk.ac.starlink.util.SplitCollector<TupleSequence,
BinList>
public abstract class BinListCollector
extends Object
implements uk.ac.starlink.util.SplitCollector<TupleSequence,BinList>
Partial SplitCollector implementation for accumulating data in BinLists.
- Since:
- 27 Sep 2019
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BinList
createDefaultBinList
(Combiner combiner, long size) Returns a BinList implementation suitable for a given number of bins and a given combiner.static BinList
mergeBinLists
(BinList binList1, BinList binList2) Returns a BinList with contents corresponding to the aggregation of two input BinLists.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface uk.ac.starlink.util.SplitCollector
accumulate
-
Constructor Details
-
BinListCollector
Constructor.- Parameters:
combiner
- combination modenbin
- bin index limit
-
-
Method Details
-
createAccumulator
- Specified by:
createAccumulator
in interfaceuk.ac.starlink.util.SplitCollector<TupleSequence,
BinList>
-
combine
- Specified by:
combine
in interfaceuk.ac.starlink.util.SplitCollector<TupleSequence,
BinList>
-
createDefaultBinList
Returns a BinList implementation suitable for a given number of bins and a given combiner. This may return an implementation based on a hash, or an array, or some combination.- Parameters:
combiner
- combinersize
- maximum number of bins
-
mergeBinLists
Returns a BinList with contents corresponding to the aggregation of two input BinLists. The result is the same as if all the data submitted to the input bin lists had instead been submitted to the output one. The result may or may not be the same object as one of the inputs. The inputs should not be used following this operation.This method will work for any BinList instances, but it is intended for use with BinLists generated by
createDefaultBinList
.- Parameters:
binList1
- first inputbinList2
- second input- Returns:
- aggregation of the inputs
-