test_class.file: tool/hash/src/test/java/org/openscience/cdk/hash/stereo/GeometryEncoderTest.java
test_class.identifier: GeometryEncoderTest
test_case.body: @Test
      public void testEncode_Anticlockwise() throws Exception {
  
          PermutationParity permutation = mock(PermutationParity.class);
          GeometricParity geometric = mock(GeometricParity.class);
  
          when(permutation.parity(any(long[].class))).thenReturn(+1);
          when(geometric.parity()).thenReturn(+1);
  
          StereoEncoder encoder = new GeometryEncoder(new int[]{1}, permutation, geometric);
          long[] prev = new long[3];
          long[] result = new long[3];
          Arrays.fill(prev, 1);
          Arrays.fill(result, 1);
  
          // check returned true
          assertTrue(encoder.encode(prev, result));
  
          // check only the value at index '1' was changed
          assertThat(result, is(new long[]{1, 15521419, 1}));
  
      }
test_case.class_method_signature: GeometryEncoderTest.testEncode_Anticlockwise()
test_case.full_signature: @Test public void testEncode_Anticlockwise()
test_case.identifier: testEncode_Anticlockwise
test_case.invocations: mock mock thenReturn when parity any thenReturn when parity fill fill assertTrue encode assertThat is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEncode_Anticlockwise()
focal_class.declarator: CLOCKWISE     = 15543053
focal_class.modifier: private static final
focal_class.original_string: private static final long       CLOCKWISE     = 15543053;
focal_class.type: long
focal_class.var_name: CLOCKWISE
focal_class.declarator: ANTICLOCKWISE = 15521419
focal_class.modifier: private static final
focal_class.original_string: private static final long       ANTICLOCKWISE = 15521419;
focal_class.type: long
focal_class.var_name: ANTICLOCKWISE
focal_class.declarator: permutation
focal_class.modifier: private final
focal_class.original_string: private final PermutationParity permutation;
focal_class.type: PermutationParity
focal_class.var_name: permutation
focal_class.declarator: geometric
focal_class.modifier: private final
focal_class.original_string: private final GeometricParity   geometric;
focal_class.type: GeometricParity
focal_class.var_name: geometric
focal_class.declarator: centres
focal_class.modifier: private final
focal_class.original_string: private final int[]             centres;
focal_class.type: int[]
focal_class.var_name: centres
focal_class.file: tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometryEncoder.java
focal_class.identifier: GeometryEncoder
focal_class.interfaces: implements StereoEncoder
focal_class.class_method_signature: GeometryEncoder.GeometryEncoder(int[] centres, PermutationParity permutation, GeometricParity geometric)
focal_class.full_signature: public  GeometryEncoder(int[] centres, PermutationParity permutation, GeometricParity geometric)
focal_class.identifier: GeometryEncoder
focal_class.modifiers: public
focal_class.parameters: (int[] centres, PermutationParity permutation, GeometricParity geometric)
focal_class.signature:  GeometryEncoder(int[] centres, PermutationParity permutation, GeometricParity geometric)
focal_class.class_method_signature: GeometryEncoder.GeometryEncoder(int centre, PermutationParity permutation, GeometricParity geometric)
focal_class.full_signature: public  GeometryEncoder(int centre, PermutationParity permutation, GeometricParity geometric)
focal_class.identifier: GeometryEncoder
focal_class.modifiers: public
focal_class.parameters: (int centre, PermutationParity permutation, GeometricParity geometric)
focal_class.signature:  GeometryEncoder(int centre, PermutationParity permutation, GeometricParity geometric)
focal_class.class_method_signature: GeometryEncoder.encode(long[] current, long[] next)
focal_class.full_signature: @Override public boolean encode(long[] current, long[] next)
focal_class.identifier: encode
focal_class.modifiers: @Override public
focal_class.parameters: (long[] current, long[] next)
focal_class.return: boolean
focal_class.signature: boolean encode(long[] current, long[] next)
focal_class.class_method_signature: GeometryEncoder.reset()
focal_class.full_signature: @Override public void reset()
focal_class.identifier: reset
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void reset()
focal_method.body: @Override
      public boolean encode(long[] current, long[] next) {
  
          int p = permutation.parity(current);
  
          // if is a permutation parity (all neighbors are different)
          if (p != 0) {
  
              // multiple with the geometric parity
              int q = geometric.parity() * p;
  
              // configure anticlockwise/clockwise
              if (q > 0) {
                  for (int i : centres) {
                      next[i] = current[i] * ANTICLOCKWISE;
                  }
              } else if (q < 0) {
                  for (int i : centres) {
                      next[i] = current[i] * CLOCKWISE;
                  }
              }
  
              // 0 parity ignored
  
              return true;
          }
          return false;
      }
focal_method.class_method_signature: GeometryEncoder.encode(long[] current, long[] next)
focal_method.full_signature: @Override public boolean encode(long[] current, long[] next)
focal_method.identifier: encode
focal_method.invocations: parity parity
focal_method.modifiers: @Override public
focal_method.parameters: (long[] current, long[] next)
focal_method.return: boolean
focal_method.signature: boolean encode(long[] current, long[] next)