示例#1
0
  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++;
  }
示例#2
0
 public int getHitsAt(double x) {
   if (range.isInside(x)) {
     int slot = bucketize(x);
     return histogram[slot];
   } else return 0;
 }