public void combine ( WSStatistic otherStat ) { if ( ! validate ( otherStat ) ) return ; AverageStatisticImpl other = ( AverageStatisticImpl ) otherStat ; boolean previousCountWasZero = ( count == 0 ) ; count += other . count ; total += other . total ; sumOfSquares += other . sumOfSquares ; // min is min of min, max is max of max // need to handle one of the Statistics not having any count so // min of 0 isn't reported erroneously if ( other . count != 0 && ( min > other . min || previousCountWasZero == true ) ) min = other . min ; if ( max < other . max ) max = other . max ; // Compare lastSampleTime if ( other . lastSampleTime > lastSampleTime ) lastSampleTime = other . lastSampleTime ; }
Combine this StatData with other StatData