java.lang.Object
auxiliary.__Counter
This class is used to count the number of times a block of code is executed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidinc(int n) Increments the counter for the given block.static voidCallinc(int)with the block id and then execute the given lambdaRunnable.static <T> TOverloaded version ofincLambda(int, Runnable)using a Supplier with a generic return type.static voidincLambdaSync(int n, Runnable method) Synchronized version ofincLambda(int, Runnable).static <T> TincLambdaSync(int n, Supplier<T> function) Synchronized version ofincLambda(int, Supplier).static voidincSync(int n) Increments the counter for the given block, in a synchronized way.
-
Constructor Details
-
__Counter
public __Counter()
-
-
Method Details
-
inc
public static void inc(int n) Increments the counter for the given block.- Parameters:
n- the block id
-
incSync
public static void incSync(int n) Increments the counter for the given block, in a synchronized way.- Parameters:
n- the block id
-
incLambda
Callinc(int)with the block id and then execute the given lambdaRunnable.- Parameters:
n- the block idmethod- the lambdaRunnableto execute
-
incLambda
Overloaded version ofincLambda(int, Runnable)using a Supplier with a generic return type. -
incLambdaSync
Synchronized version ofincLambda(int, Runnable). -
incLambdaSync
Synchronized version ofincLambda(int, Supplier).
-