public void add(double value) { if (range.isInside(value)) { int slot = bucketize(value); histogram[slot]++; maxHits = Math.max(maxHits, histogram[slot]); } else { if (value < range.getMinimum()) underflows++; else overflows++; } total++; }
public int getHitsAt(double x) { if (range.isInside(x)) { int slot = bucketize(x); return histogram[slot]; } else return 0; }