
public class LongDynamicHistogram extends LongStaticHistogram
LongStaticHistogram.Iter| Modifier and Type | Field and Description | 
|---|---|
| private double[] | cachecCache for data to be inserted. | 
| private int | cachefillCache fill size | 
| private long[] | cachevCache for data to be inserted. | 
| private int | destsizeDestination (minimum) size of the structure. | 
database, binsize, max, offset, sizeCACHE_SHIFT| Constructor and Description | 
|---|
| LongDynamicHistogram(int bins)Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected long | downsample(long[] data,
          int start,
          int end,
          int size)Perform downsampling on a number of bins. | 
| long | get(double coord)Get the value at a particular position. | 
| 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. | 
| void | increment(double coord,
         long value)Put fresh data into the histogram (or into the cache) | 
| LongStaticHistogram.Iter | iter()Get an iterator over all histogram bins. | 
| (package private) void | materialize()Materialize the histogram from the cache. | 
| private void | testResample(double coord)Test (and perform) downsampling when neede. | 
getBinNr, growSizeprivate double[] cachec
private long[] cachev
private int cachefill
private int destsize
public LongDynamicHistogram(int bins)
bins - Design number of bins - may become twice as large!void materialize()
public long get(double coord)
LongStaticHistogramget in class LongStaticHistogramcoord - Coordinatepublic void increment(double coord,
             long value)
increment in interface LongHistogramincrement in class LongStaticHistogramcoord - Coordinatevalue - Valueprivate void testResample(double coord)
coord - coordinate to accomodate.public LongStaticHistogram.Iter iter()
AbstractStaticHistogramiter in interface Histogramiter in interface LongHistogramiter in class LongStaticHistogrampublic 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 long downsample(long[] 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 two