test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/counter/ApproximateCounterTest.java
test_class.identifier: ApproximateCounterTest
test_case.body: @Test
      public void veryHighResolution() {
          for (int i = -100; i < 100; i++) {
              assertEquals(i, ApproximateCounter.calculateOffset(i, -1));
              assertEquals(i, ApproximateCounter.calculateOffset(i, 0));
              assertEquals(i, ApproximateCounter.calculateOffset(i, 1));
          }
      }
test_case.class_method_signature: ApproximateCounterTest.veryHighResolution()
test_case.full_signature: @Test public void veryHighResolution()
test_case.identifier: veryHighResolution
test_case.invocations: assertEquals calculateOffset assertEquals calculateOffset assertEquals calculateOffset
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void veryHighResolution()
focal_class.declarator: COUNT_PROPERTY_PREFIX = ":count_"
focal_class.modifier: public static final
focal_class.original_string: public static final String COUNT_PROPERTY_PREFIX = ":count_";
focal_class.type: String
focal_class.var_name: COUNT_PROPERTY_PREFIX
focal_class.declarator: COUNT_RESOLUTION = 100
focal_class.modifier: public static final
focal_class.original_string: public static final int COUNT_RESOLUTION = 100;
focal_class.type: int
focal_class.var_name: COUNT_RESOLUTION
focal_class.declarator: COUNT_MAX = 10000000
focal_class.modifier: public static final
focal_class.original_string: public static final int COUNT_MAX = 10000000;
focal_class.type: int
focal_class.var_name: COUNT_MAX
focal_class.declarator: RANDOM = new Random()
focal_class.modifier: private static final
focal_class.original_string: private static final Random RANDOM = new Random();
focal_class.type: Random
focal_class.var_name: RANDOM
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/counter/ApproximateCounter.java
focal_class.identifier: ApproximateCounter
focal_class.class_method_signature: ApproximateCounter.ApproximateCounter()
focal_class.full_signature: private  ApproximateCounter()
focal_class.identifier: ApproximateCounter
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  ApproximateCounter()
focal_class.class_method_signature: ApproximateCounter.calculateOffset(long offset, int resolution)
focal_class.full_signature: public static long calculateOffset(long offset, int resolution)
focal_class.identifier: calculateOffset
focal_class.modifiers: public static
focal_class.parameters: (long offset, int resolution)
focal_class.return: long
focal_class.signature: long calculateOffset(long offset, int resolution)
focal_class.class_method_signature: ApproximateCounter.adjustOffset(long oldCount, long calculatedOffset,
              int resolution)
focal_class.full_signature: public static long adjustOffset(long oldCount, long calculatedOffset,
              int resolution)
focal_class.identifier: adjustOffset
focal_class.modifiers: public static
focal_class.parameters: (long oldCount, long calculatedOffset,
              int resolution)
focal_class.return: long
focal_class.signature: long adjustOffset(long oldCount, long calculatedOffset,
              int resolution)
focal_class.class_method_signature: ApproximateCounter.setSeed(int seed)
focal_class.full_signature: static void setSeed(int seed)
focal_class.identifier: setSeed
focal_class.modifiers: static
focal_class.parameters: (int seed)
focal_class.return: void
focal_class.signature: void setSeed(int seed)
focal_class.class_method_signature: ApproximateCounter.adjustCountSync(NodeBuilder builder, long offset)
focal_class.full_signature: public static void adjustCountSync(NodeBuilder builder, long offset)
focal_class.identifier: adjustCountSync
focal_class.modifiers: public static
focal_class.parameters: (NodeBuilder builder, long offset)
focal_class.return: void
focal_class.signature: void adjustCountSync(NodeBuilder builder, long offset)
focal_class.class_method_signature: ApproximateCounter.adjustCountSync(NodeBuilder builder, boolean added)
focal_class.full_signature: private static void adjustCountSync(NodeBuilder builder, boolean added)
focal_class.identifier: adjustCountSync
focal_class.modifiers: private static
focal_class.parameters: (NodeBuilder builder, boolean added)
focal_class.return: void
focal_class.signature: void adjustCountSync(NodeBuilder builder, boolean added)
focal_class.class_method_signature: ApproximateCounter.getMaxCount(NodeBuilder node, boolean added)
focal_class.full_signature: private static int getMaxCount(NodeBuilder node, boolean added)
focal_class.identifier: getMaxCount
focal_class.modifiers: private static
focal_class.parameters: (NodeBuilder node, boolean added)
focal_class.return: int
focal_class.signature: int getMaxCount(NodeBuilder node, boolean added)
focal_class.class_method_signature: ApproximateCounter.getCountSync(NodeState node)
focal_class.full_signature: public static long getCountSync(NodeState node)
focal_class.identifier: getCountSync
focal_class.modifiers: public static
focal_class.parameters: (NodeState node)
focal_class.return: long
focal_class.signature: long getCountSync(NodeState node)
focal_method.body: public static long calculateOffset(long offset, int resolution) {
          if (offset == 0 || resolution <= 1) {
              return offset;
          }
          int add = resolution;
          if (offset < 0) {
              offset = -offset;
              add = -add;
          }
          long result = 0;
          for (long i = 0; i < offset; i++) {
              if (RANDOM.nextInt(resolution) == 0) {
                  result += add;
              }
          }
          return result;
      }
focal_method.class_method_signature: ApproximateCounter.calculateOffset(long offset, int resolution)
focal_method.full_signature: public static long calculateOffset(long offset, int resolution)
focal_method.identifier: calculateOffset
focal_method.invocations: nextInt
focal_method.modifiers: public static
focal_method.parameters: (long offset, int resolution)
focal_method.return: long
focal_method.signature: long calculateOffset(long offset, int resolution)