BinList.Result
Constructor and Description |
---|
HashBinList(long size,
Combiner combiner)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addBins(BinList other)
Accumulates all the data from another BinList into this one.
|
static BinList.Result |
createHashResult(Map<Long,Double> map)
Returns a new Result instance based on a Map.
|
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.
|
Map<Long,Combiner.Container> |
getMap()
Returns the hash used to store this bin list's state.
|
BinList.Result |
getResult()
Returns an object containing the result values accumulated into
the bins so far.
|
long |
getSize()
Returns the maximum number of bins.
|
void |
submitToBin(long index,
double value)
Adds a given numeric value to the bin at the given index.
|
public HashBinList(long size, Combiner combiner)
size
- number of binscombiner
- combinerpublic long getSize()
BinList
public Combiner getCombiner()
BinList
getCombiner
in interface BinList
public void submitToBin(long index, double value)
BinList
submitToBin
in interface BinList
index
- bin indexvalue
- 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 void addBins(BinList other)
other
had been submitted to this.
The other list must be of the same type (have the same combiner) as this one.
other
- second BinList compatible with this oneClassCastException
- if other
's type
does not match this onepublic 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 Map<Long,Combiner.Container> getMap()
public static BinList.Result createHashResult(Map<Long,Double> map)
map
- map of valuesmap
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.