test_class.file: tool/hash/src/test/java/org/openscience/cdk/hash/stereo/GeometricDoubleBondEncoderFactoryTest.java
test_class.identifier: GeometricDoubleBondEncoderFactoryTest
test_case.body: @Test
      public void testAccept_CumulatedDoubleBond() throws Exception {
  
          IAtom atom = mock(IAtom.class);
          IBond a = mock(IBond.class);
          IBond b = mock(IBond.class);
          IBond c = mock(IBond.class);
  
          List<IBond> bonds = Arrays.asList(a, b, c);
  
          when(atom.getHybridization()).thenReturn(IAtomType.Hybridization.SP2);
          when(a.getOrder()).thenReturn(IBond.Order.DOUBLE);
          assertTrue(GeometricDoubleBondEncoderFactory.accept(atom, bonds));
          when(b.getOrder()).thenReturn(IBond.Order.DOUBLE);
          assertFalse(GeometricDoubleBondEncoderFactory.accept(atom, bonds));
      }
test_case.class_method_signature: GeometricDoubleBondEncoderFactoryTest.testAccept_CumulatedDoubleBond()
test_case.full_signature: @Test public void testAccept_CumulatedDoubleBond()
test_case.identifier: testAccept_CumulatedDoubleBond
test_case.invocations: mock mock mock mock asList thenReturn when getHybridization thenReturn when getOrder assertTrue accept thenReturn when getOrder assertFalse accept
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAccept_CumulatedDoubleBond()
focal_class.file: tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricDoubleBondEncoderFactory.java
focal_class.identifier: GeometricDoubleBondEncoderFactory
focal_class.interfaces: implements StereoEncoderFactory
focal_class.class_method_signature: GeometricDoubleBondEncoderFactory.create(IAtomContainer container, int[][] graph)
focal_class.full_signature: @Override public StereoEncoder create(IAtomContainer container, int[][] graph)
focal_class.identifier: create
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainer container, int[][] graph)
focal_class.return: StereoEncoder
focal_class.signature: StereoEncoder create(IAtomContainer container, int[][] graph)
focal_class.class_method_signature: GeometricDoubleBondEncoderFactory.newEncoder(IAtomContainer container, IAtom left, IAtom leftParent, IAtom right,
              IAtom rightParent, int[][] graph)
focal_class.full_signature: static StereoEncoder newEncoder(IAtomContainer container, IAtom left, IAtom leftParent, IAtom right,
              IAtom rightParent, int[][] graph)
focal_class.identifier: newEncoder
focal_class.modifiers: static
focal_class.parameters: (IAtomContainer container, IAtom left, IAtom leftParent, IAtom right,
              IAtom rightParent, int[][] graph)
focal_class.return: StereoEncoder
focal_class.signature: StereoEncoder newEncoder(IAtomContainer container, IAtom left, IAtom leftParent, IAtom right,
              IAtom rightParent, int[][] graph)
focal_class.class_method_signature: GeometricDoubleBondEncoderFactory.geometric(IAtomContainer mol, int l, int r, int l1, int l2, int r1, int r2)
focal_class.full_signature: static GeometricParity geometric(IAtomContainer mol, int l, int r, int l1, int l2, int r1, int r2)
focal_class.identifier: geometric
focal_class.modifiers: static
focal_class.parameters: (IAtomContainer mol, int l, int r, int l1, int l2, int r1, int r2)
focal_class.return: GeometricParity
focal_class.signature: GeometricParity geometric(IAtomContainer mol, int l, int r, int l1, int l2, int r1, int r2)
focal_class.class_method_signature: GeometricDoubleBondEncoderFactory.permutation(int[] neighbors)
focal_class.full_signature: static PermutationParity permutation(int[] neighbors)
focal_class.identifier: permutation
focal_class.modifiers: static
focal_class.parameters: (int[] neighbors)
focal_class.return: PermutationParity
focal_class.signature: PermutationParity permutation(int[] neighbors)
focal_class.class_method_signature: GeometricDoubleBondEncoderFactory.moveToBack(int[] neighbors, int v)
focal_class.full_signature: static int[] moveToBack(int[] neighbors, int v)
focal_class.identifier: moveToBack
focal_class.modifiers: static
focal_class.parameters: (int[] neighbors, int v)
focal_class.return: int[]
focal_class.signature: int[] moveToBack(int[] neighbors, int v)
focal_class.class_method_signature: GeometricDoubleBondEncoderFactory.accept(IAtom atom, List<IBond> bonds)
focal_class.full_signature: static boolean accept(IAtom atom, List<IBond> bonds)
focal_class.identifier: accept
focal_class.modifiers: static
focal_class.parameters: (IAtom atom, List<IBond> bonds)
focal_class.return: boolean
focal_class.signature: boolean accept(IAtom atom, List<IBond> bonds)
focal_method.body: static boolean accept(IAtom atom, List<IBond> bonds) {
  
          int dbCount = 0;
  
          // not SP2
          if (!IAtomType.Hybridization.SP2.equals(atom.getHybridization())) return false;
  
          // only have one neighbour (which is the other atom) -> this is no configurable
          if (bonds.size() == 1) return false;
  
          for (IBond bond : bonds) {
  
              // increment the number of double bonds
              if (DOUBLE.equals(bond.getOrder())) dbCount++;
  
              // up/down bonds sometimes used to indicate E/Z
              IBond.Stereo stereo = bond.getStereo();
              if (IBond.Stereo.UP_OR_DOWN.equals(stereo) || IBond.Stereo.UP_OR_DOWN_INVERTED.equals(stereo))
                  return false;
  
          }
  
          // not cumulated
          return dbCount == 1;
      }
focal_method.class_method_signature: GeometricDoubleBondEncoderFactory.accept(IAtom atom, List<IBond> bonds)
focal_method.full_signature: static boolean accept(IAtom atom, List<IBond> bonds)
focal_method.identifier: accept
focal_method.invocations: equals getHybridization size equals getOrder getStereo equals equals
focal_method.modifiers: static
focal_method.parameters: (IAtom atom, List<IBond> bonds)
focal_method.return: boolean
focal_method.signature: boolean accept(IAtom atom, List<IBond> bonds)