test_class.declarator: permutationParity = new BasicPermutationParity(new int[]{0, 1, 2, 3})
test_class.original_string: BasicPermutationParity permutationParity = new BasicPermutationParity(new int[]{0, 1, 2, 3});
test_class.type: BasicPermutationParity
test_class.var_name: permutationParity
test_class.file: tool/hash/src/test/java/org/openscience/cdk/hash/stereo/BasicPermutationParityTest.java
test_class.identifier: BasicPermutationParityTest
test_case.body: @Test
      public void testParity_All() throws Exception {
          assertEquals(1, permutationParity.parity(new long[]{1, 2, 3, 4}));
          assertEquals(-1, permutationParity.parity(new long[]{2, 1, 3, 4}));
          assertEquals(-1, permutationParity.parity(new long[]{1, 3, 2, 4}));
          assertEquals(1, permutationParity.parity(new long[]{3, 1, 2, 4}));
          assertEquals(1, permutationParity.parity(new long[]{2, 3, 1, 4}));
          assertEquals(-1, permutationParity.parity(new long[]{3, 2, 1, 4}));
          assertEquals(-1, permutationParity.parity(new long[]{1, 2, 4, 3}));
          assertEquals(1, permutationParity.parity(new long[]{2, 1, 4, 3}));
          assertEquals(1, permutationParity.parity(new long[]{1, 4, 2, 3}));
          assertEquals(-1, permutationParity.parity(new long[]{4, 1, 2, 3}));
          assertEquals(-1, permutationParity.parity(new long[]{2, 4, 1, 3}));
          assertEquals(1, permutationParity.parity(new long[]{4, 2, 1, 3}));
          assertEquals(1, permutationParity.parity(new long[]{1, 3, 4, 2}));
          assertEquals(-1, permutationParity.parity(new long[]{3, 1, 4, 2}));
          assertEquals(-1, permutationParity.parity(new long[]{1, 4, 3, 2}));
          assertEquals(1, permutationParity.parity(new long[]{4, 1, 3, 2}));
          assertEquals(1, permutationParity.parity(new long[]{3, 4, 1, 2}));
          assertEquals(-1, permutationParity.parity(new long[]{4, 3, 1, 2}));
          assertEquals(-1, permutationParity.parity(new long[]{2, 3, 4, 1}));
          assertEquals(1, permutationParity.parity(new long[]{3, 2, 4, 1}));
          assertEquals(1, permutationParity.parity(new long[]{2, 4, 3, 1}));
          assertEquals(-1, permutationParity.parity(new long[]{4, 2, 3, 1}));
          assertEquals(-1, permutationParity.parity(new long[]{3, 4, 2, 1}));
          assertEquals(1, permutationParity.parity(new long[]{4, 3, 2, 1}));
  
      }
test_case.class_method_signature: BasicPermutationParityTest.testParity_All()
test_case.full_signature: @Test public void testParity_All()
test_case.identifier: testParity_All
test_case.invocations: assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity assertEquals parity
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParity_All()
focal_class.declarator: indices
focal_class.modifier: private final
focal_class.original_string: private final int[] indices;
focal_class.type: int[]
focal_class.var_name: indices
focal_class.file: tool/hash/src/main/java/org/openscience/cdk/hash/stereo/BasicPermutationParity.java
focal_class.identifier: BasicPermutationParity
focal_class.class_method_signature: BasicPermutationParity.BasicPermutationParity(int[] indices)
focal_class.full_signature: public  BasicPermutationParity(int[] indices)
focal_class.identifier: BasicPermutationParity
focal_class.modifiers: public
focal_class.parameters: (int[] indices)
focal_class.signature:  BasicPermutationParity(int[] indices)
focal_class.class_method_signature: BasicPermutationParity.parity(long[] current)
focal_class.full_signature: @Override public int parity(long[] current)
focal_class.identifier: parity
focal_class.modifiers: @Override public
focal_class.parameters: (long[] current)
focal_class.return: int
focal_class.signature: int parity(long[] current)
focal_class.class_method_signature: BasicPermutationParity.compare(long a, long b)
focal_class.full_signature: private static int compare(long a, long b)
focal_class.identifier: compare
focal_class.modifiers: private static
focal_class.parameters: (long a, long b)
focal_class.return: int
focal_class.signature: int compare(long a, long b)
focal_class.superclass: extends PermutationParity
focal_method.body: @Override
      public int parity(long[] current) {
  
          int count = 0;
  
          for (int i = 0, n = indices.length; i < n; i++) {
              for (int j = i + 1; j < n; j++) {
                  int cmp = compare(current[indices[i]], current[indices[j]]);
                  if (cmp == 0)
                      return 0;
                  else if (cmp > 0) count++;
              }
          }
  
          // value is odd, -1 or value is even +1
          return Integer.lowestOneBit(count) == 1 ? -1 : +1;
      }
focal_method.class_method_signature: BasicPermutationParity.parity(long[] current)
focal_method.full_signature: @Override public int parity(long[] current)
focal_method.identifier: parity
focal_method.invocations: compare lowestOneBit
focal_method.modifiers: @Override public
focal_method.parameters: (long[] current)
focal_method.return: int
focal_method.signature: int parity(long[] current)