test_class.declarator: smilesParser
test_class.modifier: static
test_class.original_string: static SmilesParser smilesParser;
test_class.type: SmilesParser
test_class.var_name: smilesParser
test_class.file: tool/fragment/src/test/java/org/openscience/cdk/fragment/FragmentUtilsTest.java
test_class.identifier: FragmentUtilsTest
test_class.superclass: extends CDKTestCase
test_case.body: @Test
      public void testTraversal_Chain() {
  
          IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();
  
          IAtom[] atoms = new IAtom[]{builder.newInstance(IAtom.class, "C"), builder.newInstance(IAtom.class, "C"),
                  builder.newInstance(IAtom.class, "C"), builder.newInstance(IAtom.class, "C"),
                  builder.newInstance(IAtom.class, "C"), builder.newInstance(IAtom.class, "C")};
          IBond[] bonds = new IBond[]{builder.newInstance(IBond.class, atoms[0], atoms[1]),
                  builder.newInstance(IBond.class, atoms[1], atoms[2]),
                  builder.newInstance(IBond.class, atoms[2], atoms[3]),
                  builder.newInstance(IBond.class, atoms[3], atoms[4]),
                  builder.newInstance(IBond.class, atoms[4], atoms[5])};
  
          IAtomContainer m = builder.newInstance(IAtomContainer.class, 0, 0, 0, 0);
          m.setAtoms(atoms);
          m.setBonds(bonds);
  
          List<IBond> accumulator = new ArrayList<IBond>();
  
          // traverse from one end
          FragmentUtils.traverse(m, atoms[0], accumulator);
  
          assertThat(accumulator.size(), is(5));
          assertThat(accumulator.get(0), is(bonds[0]));
          assertThat(accumulator.get(1), is(bonds[1]));
          assertThat(accumulator.get(2), is(bonds[2]));
          assertThat(accumulator.get(3), is(bonds[3]));
          assertThat(accumulator.get(4), is(bonds[4]));
  
          // traverse from the middle
          accumulator.clear();
          FragmentUtils.traverse(m, atoms[3], accumulator);
  
          assertThat(accumulator.size(), is(5));
  
          assertThat(accumulator.get(0), is(bonds[2]));
          assertThat(accumulator.get(1), is(bonds[1]));
          assertThat(accumulator.get(2), is(bonds[0]));
          assertThat(accumulator.get(3), is(bonds[3]));
          assertThat(accumulator.get(4), is(bonds[4]));
      }
test_case.class_method_signature: FragmentUtilsTest.testTraversal_Chain()
test_case.full_signature: @Test public void testTraversal_Chain()
test_case.identifier: testTraversal_Chain
test_case.invocations: getInstance newInstance newInstance newInstance newInstance newInstance newInstance newInstance newInstance newInstance newInstance newInstance newInstance setAtoms setBonds traverse assertThat size is assertThat get is assertThat get is assertThat get is assertThat get is assertThat get is clear traverse assertThat size is assertThat get is assertThat get is assertThat get is assertThat get is assertThat get is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testTraversal_Chain()
focal_class.file: tool/fragment/src/main/java/org/openscience/cdk/fragment/FragmentUtils.java
focal_class.identifier: FragmentUtils
focal_class.class_method_signature: FragmentUtils.splitMolecule(IAtomContainer atomContainer, IBond bond)
focal_class.full_signature: protected static List<IAtomContainer> splitMolecule(IAtomContainer atomContainer, IBond bond)
focal_class.identifier: splitMolecule
focal_class.modifiers: protected static
focal_class.parameters: (IAtomContainer atomContainer, IBond bond)
focal_class.return: List<IAtomContainer>
focal_class.signature: List<IAtomContainer> splitMolecule(IAtomContainer atomContainer, IBond bond)
focal_class.class_method_signature: FragmentUtils.makeAtomContainer(IAtom atom, List<IBond> parts, IAtom excludedAtom)
focal_class.full_signature: protected static IAtomContainer makeAtomContainer(IAtom atom, List<IBond> parts, IAtom excludedAtom)
focal_class.identifier: makeAtomContainer
focal_class.modifiers: protected static
focal_class.parameters: (IAtom atom, List<IBond> parts, IAtom excludedAtom)
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer makeAtomContainer(IAtom atom, List<IBond> parts, IAtom excludedAtom)
focal_class.class_method_signature: FragmentUtils.traverse(IAtomContainer atomContainer, IAtom atom, List<IBond> bondList)
focal_class.full_signature: protected static List<IBond> traverse(IAtomContainer atomContainer, IAtom atom, List<IBond> bondList)
focal_class.identifier: traverse
focal_class.modifiers: protected static
focal_class.parameters: (IAtomContainer atomContainer, IAtom atom, List<IBond> bondList)
focal_class.return: List<IBond>
focal_class.signature: List<IBond> traverse(IAtomContainer atomContainer, IAtom atom, List<IBond> bondList)
focal_method.body: protected static List<IBond> traverse(IAtomContainer atomContainer, IAtom atom, List<IBond> bondList) {
          List<IBond> connectedBonds = atomContainer.getConnectedBondsList(atom);
          for (IBond aBond : connectedBonds) {
              if (bondList.contains(aBond)) continue;
              bondList.add(aBond);
              IAtom nextAtom = aBond.getOther(atom);
              if (atomContainer.getConnectedBondsCount(nextAtom) == 1) continue;
              traverse(atomContainer, nextAtom, bondList);
          }
          return bondList;
      }
focal_method.class_method_signature: FragmentUtils.traverse(IAtomContainer atomContainer, IAtom atom, List<IBond> bondList)
focal_method.full_signature: protected static List<IBond> traverse(IAtomContainer atomContainer, IAtom atom, List<IBond> bondList)
focal_method.identifier: traverse
focal_method.invocations: getConnectedBondsList contains add getOther getConnectedBondsCount traverse
focal_method.modifiers: protected static
focal_method.parameters: (IAtomContainer atomContainer, IAtom atom, List<IBond> bondList)
focal_method.return: List<IBond>
focal_method.signature: List<IBond> traverse(IAtomContainer atomContainer, IAtom atom, List<IBond> bondList)