com.vladsch.flexmark.util.misc.MinMaxAvgInt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of driver-cql-shaded Show documentation
Show all versions of driver-cql-shaded Show documentation
A Shaded CQL ActivityType driver for http://nosqlbench.io/
package com.vladsch.flexmark.util.misc;
public class MinMaxAvgInt {
private int min = Integer.MAX_VALUE;
private int max = Integer.MIN_VALUE;
private int total = 0;
public MinMaxAvgInt() {
}
public void add(int value) {
total += value;
min = Math.min(min, value);
max = Math.max(max, value);
}
public void add(MinMaxAvgInt other) {
total += other.total;
min = Math.min(min, other.min);
max = Math.max(max, other.max);
}
public void diff(int start, int end) {
add(end - start);
}
public int getMin() {
return min;
}
public int getMax() {
return max;
}
public int getTotal() {
return total;
}
public int getAvg(int count) {
return count == 0 ? 0 : total / count;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy