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 Constructor Description AbstractStatisticsHandlerNumeric()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddValue(long nValue)longgetAverage()intgetInvocationCount()longgetMax()longgetMin()BigIntegergetSum()
-
-
-
Method Detail
-
getInvocationCount
@Nonnegative public final int getInvocationCount()
- Specified by:
getInvocationCountin interfaceIStatisticsHandler- Returns:
- The number of times this statistics hander was invoked.
-
addValue
protected final void addValue(long nValue)
-
getSum
@Nonnull public final BigInteger getSum()
- Specified by:
getSumin interfaceIStatisticsHandlerNumeric- Returns:
- The sum of aggregated values.
-
getMin
@CheckForSigned public final long getMin()
- Specified by:
getMinin interfaceIStatisticsHandlerNumeric- Returns:
- The smallest value. Returns
CGlobal.ILLEGAL_ULONGif the invocation count is 0.
-
getAverage
@CheckForSigned public final long 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
@CheckForSigned public long getMax()
- Specified by:
getMaxin interfaceIStatisticsHandlerNumeric- Returns:
- The biggest value. Returns
CGlobal.ILLEGAL_ULONGif the invocation count is 0.
-
-