/** * Create a new histogram, after applying the function on each of the event * counters. */ public Histogram modifyEventCounters(BiFunction<Range, Double, Double> fn) { return new Histogram(stream() .map(entry -> { entry.setCount(fn.apply(entry.getRange(), entry.getCount())); return entry; })); }
/** * Create a new histogram, after applying the function on each of the event * counters. */ public Histogram modifyEventCounters(BiFunction<Range, Double, Double> fn) { return new Histogram(stream() .map(entry -> { entry.setCount(fn.apply(entry.getRange(), entry.getCount())); return entry; })); }