
T - Data typepublic abstract class AbstractObjDynamicHistogram<T> extends AbstractObjStaticHistogram<T>
AbstractObjStaticHistogram.Iter| Modifier and Type | Field and Description | 
|---|---|
| private int | cachefillCache fill size | 
| private double[] | cachepossCache for positions to be inserted. | 
| private Object[] | cachevalsCache for data to be inserted. | 
| private int | destsizeDestination (minimum) size of the structure. | 
database, binsize, max, offset, sizeCACHE_SHIFT| Constructor and Description | 
|---|
| AbstractObjDynamicHistogram(int bins)Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected abstract T | aggregate(T first,
         T second)Rule to combine two bins or entries into one. | 
| protected abstract T | cloneForCache(T data)Clone a data passed to the algorithm for computing the initial size. | 
| protected abstract T | downsample(Object[] data,
          int start,
          int end,
          int size)Perform downsampling on a number of bins. | 
| T | get(double coord)Access the value of a bin with new data. | 
| double | getBinsize()Get the size (width) of a bin. | 
| double | getCoverMaximum()Get maximum (covered by bins, not data!) | 
| double | getCoverMinimum()Get minimum (covered by bins, not data!) | 
| int | getNumBins()Get the number of bins actually in use. | 
| AbstractObjStaticHistogram.Iter | iter()Get an iterator over all histogram bins. | 
| (package private) void | materialize()Materialize the histogram from the cache. | 
| void | putData(double coord,
       T value)Put fresh data into the histogram (or into the cache) | 
| private void | testResample(double coord)Test (and perform) downsampling when neede. | 
makeObjectgetBinNr, growSizeprivate double[] cacheposs
private Object[] cachevals
private int cachefill
private int destsize
public AbstractObjDynamicHistogram(int bins)
bins - Design number of bins - may become twice as large!void materialize()
public T get(double coord)
AbstractObjStaticHistogramget in class AbstractObjStaticHistogram<T>coord - Coordinatepublic void putData(double coord,
           T value)
coord - Coordinatevalue - Valueprivate void testResample(double coord)
coord - coordinate to accomodate.public AbstractObjStaticHistogram.Iter iter()
AbstractStaticHistogramiter in interface Histogramiter in interface ObjHistogram<T>iter in class AbstractObjStaticHistogram<T>public int getNumBins()
AbstractStaticHistogramgetNumBins in interface HistogramgetNumBins in class AbstractStaticHistogrampublic double getBinsize()
AbstractStaticHistogramgetBinsize in interface HistogramgetBinsize in class AbstractStaticHistogrampublic double getCoverMinimum()
AbstractStaticHistogramgetCoverMinimum in interface HistogramgetCoverMinimum in class AbstractStaticHistogrampublic double getCoverMaximum()
AbstractStaticHistogramgetCoverMaximum in interface HistogramgetCoverMaximum in class AbstractStaticHistogramprotected abstract T downsample(Object[] data, int start, int end, int size)
data - Data array (needs cast!)start - Interval startend - Interval end (exclusive)size - Intended size - extra bins are assumed to be empty, should be a
        power of twoprotected abstract T aggregate(T first, T second)
first - First bin valuesecond - Second bin value