1 17 18 package org.objectweb.jac.lib.stats; 19 20 public class Stat { 21 public Stat() { 22 } 23 24 public Stat(double sum, long count, double min, double max) { 25 this.sum = sum; 26 this.count = count; 27 this.min = min; 28 this.max = max; 29 } 30 31 double sum; 32 public double getSum() { 33 return sum; 34 } 35 public void setSum(double newSum) { 36 this.sum = newSum; 37 } 38 39 long count; 40 public long getCount() { 41 return count; 42 } 43 public void setCount(long count) { 44 this.count = count; 45 } 46 47 public double getAverage() { 48 return count!=0 ? sum / count : Double.NaN; 49 } 50 51 double min; 52 public double getMin() { 53 return min; 54 } 55 public void setMin(double newMin) { 56 this.min = newMin; 57 } 58 59 double max; 60 public double getMax() { 61 return max; 62 } 63 public void setMax(double newMax) { 64 this.max = newMax; 65 } 66 } 67 | Popular Tags |