
org.snpeff.stats.Average Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of SnpEff Show documentation
Show all versions of SnpEff Show documentation
Variant annotation and effect prediction package.
The newest version!
package org.snpeff.stats;
/**
* A simple class that calculates averages
*
* @author pcingola
*/
public class Average {
int count = 0;
double sum = 0;
public void add(double add) {
sum += add;
count++;
}
public double getAvg() {
return count > 0 ? sum / count : 0.0;
}
public int getCount() {
return count;
}
public double getSum() {
return sum;
}
public void reset() {
count = 0;
sum = 0;
}
@Override
public String toString() {
return Long.toString(count);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy