public class AdaptiveBinList extends Object implements BinList
BinList.Result
Constructor and Description |
---|
AdaptiveBinList(int size,
Combiner combiner,
int factThresh)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
BinList |
getBaseBinList()
Returns the bin list to which this one is currently delegating
its operations.
|
Combiner.Container |
getBinContainer(long index)
Returns a container representing the current contents of a given bin.
|
Combiner |
getCombiner()
Returns the combination method used for bins.
|
BinList.Result |
getResult()
Returns an object containing the result values accumulated into
the bins so far.
|
long |
getSize()
Returns the maximum number of bins.
|
boolean |
isHash()
Indicates which underlying BinList implementation is currently in use.
|
void |
submitToBin(long index,
double datum)
Adds a given numeric value to the bin at the given index.
|
public AdaptiveBinList(int size, Combiner combiner, int factThresh)
factThresh
tuning parameter should be set to a
value close to the ratio of HashBinList bin size to ArrayBinList
bin size (in terms of storage). Object overhead is typically
2 words (16 bytes), so if the array has one double per bin and
the hash has one (Long,Combiner.Container) pair per bin,
the ratio will be at least 6.size
- maximum number of binscombiner
- combinerfactThresh
- thershold factor - once size/factThresh bins
are occupied, an array will be used insteadpublic Combiner getCombiner()
BinList
getCombiner
in interface BinList
public long getSize()
BinList
public void submitToBin(long index, double datum)
BinList
submitToBin
in interface BinList
index
- bin indexdatum
- finite value to submit to the binpublic Combiner.Container getBinContainer(long index)
BinList
This method is here to support conversion between different BinList implementations.
getBinContainer
in interface BinList
index
- bin indexpublic BinList.Result getResult()
BinList
It is up to implementations to decide how to implement this method.
In some cases the return value may be an adapter that extracts results
as required from the data structure used for value accumulation,
but in others it may return a new data structure which copies
the accumulated values to a more compact form up front.
Therefore this may or may not be an expensive method, and the return
value may or may not be affected by subsequent
BinList.submitToBin(long, double)
calls.
public BinList getBaseBinList()
public boolean isHash()
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.