Package com.helger.commons.statistics
Class StatisticsHandlerKeyedCounter
java.lang.Object
com.helger.commons.statistics.StatisticsHandlerKeyedCounter
- All Implemented Interfaces:
IMutableStatisticsHandlerKeyedCounter,IStatisticsHandler,IStatisticsHandlerKeyed,IStatisticsHandlerKeyedCounter
@ThreadSafe
public class StatisticsHandlerKeyedCounter
extends Object
implements IMutableStatisticsHandlerKeyedCounter
Default implementation of
IMutableStatisticsHandlerKeyedCounter- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet the count of a certain key.intintgetInvocationCount(String sKey) Get the invocation count for a single key.voidIncrement by nMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.helger.commons.statistics.IMutableStatisticsHandlerKeyedCounter
increment
-
Constructor Details
-
StatisticsHandlerKeyedCounter
public StatisticsHandlerKeyedCounter()
-
-
Method Details
-
getInvocationCount
- Specified by:
getInvocationCountin interfaceIStatisticsHandler- Returns:
- The number of times this statistics hander was invoked.
-
increment
Description copied from interface:IMutableStatisticsHandlerKeyedCounterIncrement by n- Specified by:
incrementin interfaceIMutableStatisticsHandlerKeyedCounter- Parameters:
sKey- The key to be incremented.nByHowMany- The amount to increment. May be negative as well
-
getAllKeys
- Specified by:
getAllKeysin interfaceIStatisticsHandlerKeyed- Returns:
- A collection of all keys that have a value assigned. Never
null.
-
getCount
Description copied from interface:IStatisticsHandlerKeyedCounterGet the count of a certain key.- Specified by:
getCountin interfaceIStatisticsHandlerKeyedCounter- Parameters:
sKey- The key to retrieve the count from- Returns:
CGlobal.ILLEGAL_ULONGif no such key is present.
-
getInvocationCount
Description copied from interface:IStatisticsHandlerKeyedGet the invocation count for a single key.- Specified by:
getInvocationCountin interfaceIStatisticsHandlerKeyed- Parameters:
sKey- The key to be queried. May benull.- Returns:
- The invocation count for a single key or
CGlobal.ILLEGAL_UINTif no such key exists
-