Package com.helger.commons.statistics
Class AbstractStatisticsHandlerNumeric
java.lang.Object
com.helger.commons.statistics.AbstractStatisticsHandlerNumeric
- All Implemented Interfaces:
IStatisticsHandler,IStatisticsHandlerNumeric
- Direct Known Subclasses:
StatisticsHandlerSize,StatisticsHandlerTimer
@ThreadSafe
public abstract class AbstractStatisticsHandlerNumeric
extends Object
implements IStatisticsHandlerNumeric
Abstract base class for numeric statistic handler
- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidaddValue(long nValue) final longfinal intlonggetMax()final longgetMin()final BigIntegergetSum()
-
Constructor Details
-
AbstractStatisticsHandlerNumeric
public AbstractStatisticsHandlerNumeric()
-
-
Method Details
-
getInvocationCount
- Specified by:
getInvocationCountin interfaceIStatisticsHandler- Returns:
- The number of times this statistics hander was invoked.
-
addValue
protected final void addValue(long nValue) -
getSum
- Specified by:
getSumin interfaceIStatisticsHandlerNumeric- Returns:
- The sum of aggregated values.
-
getMin
- Specified by:
getMinin interfaceIStatisticsHandlerNumeric- Returns:
- The smallest value. Returns
CGlobal.ILLEGAL_ULONGif the invocation count is 0.
-
getAverage
- Specified by:
getAveragein interfaceIStatisticsHandlerNumeric- Returns:
- The average value (=sum/invocationCount). Returns
CGlobal.ILLEGAL_ULONGif the invocation count is 0 to avoid a division by 0.
-
getMax
- Specified by:
getMaxin interfaceIStatisticsHandlerNumeric- Returns:
- The biggest value. Returns
CGlobal.ILLEGAL_ULONGif the invocation count is 0.
-