Package auxiliary

Class __Counter

java.lang.Object
auxiliary.__Counter

public class __Counter extends Object
This class is used to count the number of times a block of code is executed.
  • 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

      public static void incLambda(int n, Runnable method)
      Call inc(int) with the block id and then execute the given lambda Runnable.
      Parameters:
      n - the block id
      method - the lambda Runnable to execute
    • incLambda

      public static <T> T incLambda(int n, Supplier<T> function)
      Overloaded version of incLambda(int, Runnable) using a Supplier with a generic return type.
    • incLambdaSync

      public static void incLambdaSync(int n, Runnable method)
      Synchronized version of incLambda(int, Runnable).
    • incLambdaSync

      public static <T> T incLambdaSync(int n, Supplier<T> function)
      Synchronized version of incLambda(int, Supplier).