test_class.declarator: ATOMTYPE_LIST = "structgen_atomtypes.owl"
test_class.modifier: private final static
test_class.original_string: private final static String          ATOMTYPE_LIST = "structgen_atomtypes.owl";
test_class.type: String
test_class.var_name: ATOMTYPE_LIST
test_class.declarator: factory       = AtomTypeFactory.getInstance("org/openscience/cdk/config/data/"
                                                                 + ATOMTYPE_LIST, SilentChemObjectBuilder.getInstance())
test_class.modifier: private final static
test_class.original_string: private final static AtomTypeFactory factory       = AtomTypeFactory.getInstance("org/openscience/cdk/config/data/"
                                                                 + ATOMTYPE_LIST, SilentChemObjectBuilder.getInstance());
test_class.type: AtomTypeFactory
test_class.var_name: factory
test_class.declarator: testedAtomTypes = new HashMap<String, Integer>()
test_class.modifier: private static
test_class.original_string: private static Map<String, Integer> testedAtomTypes = new HashMap<String, Integer>();
test_class.type: Map<String, Integer>
test_class.var_name: testedAtomTypes
test_class.file: tool/structgen/src/test/java/org/openscience/cdk/atomtype/StructGenMatcherTest.java
test_class.identifier: StructGenMatcherTest
test_class.superclass: extends AbstractAtomTypeTest
test_case.body: @Test
      public void testIodine() throws Exception {
          IAtomContainer mol = DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class);
          IAtom atom1 = DefaultChemObjectBuilder.getInstance().newInstance(IAtom.class, "C");
          atom1.setImplicitHydrogenCount(0);
          mol.addAtom(atom1);
          for (int i = 0; i < 4; i++) {
              IAtom floruineAtom = DefaultChemObjectBuilder.getInstance().newInstance(IAtom.class, "I");
              mol.addAtom(floruineAtom);
              IBond bond = DefaultChemObjectBuilder.getInstance().newInstance(IBond.class, floruineAtom, atom1);
              mol.addBond(bond);
          }
  
          StructGenMatcher matcher = new StructGenMatcher();
          IAtomType matched = matcher.findMatchingAtomType(mol, mol.getAtom(0));
          assertAtomType(testedAtomTypes, "C4", matched);
  
          for (int i = 1; i < mol.getAtomCount(); i++) {
              IAtom atom = mol.getAtom(i);
              matched = matcher.findMatchingAtomType(mol, atom);
              assertAtomType(testedAtomTypes, "atom " + i + " failed to match", "I1", matched);
          }
      }
test_case.class_method_signature: StructGenMatcherTest.testIodine()
test_case.full_signature: @Test public void testIodine()
test_case.identifier: testIodine
test_case.invocations: newInstance getInstance newInstance getInstance setImplicitHydrogenCount addAtom newInstance getInstance addAtom newInstance getInstance addBond findMatchingAtomType getAtom assertAtomType getAtomCount getAtom findMatchingAtomType assertAtomType
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testIodine()
focal_class.declarator: factory = null
focal_class.modifier: private static
focal_class.original_string: private static AtomTypeFactory factory = null;
focal_class.type: AtomTypeFactory
focal_class.var_name: factory
focal_class.declarator: logger  = LoggingToolFactory.createLoggingTool(StructGenMatcher.class)
focal_class.modifier: private static
focal_class.original_string: private static ILoggingTool    logger  = LoggingToolFactory.createLoggingTool(StructGenMatcher.class);
focal_class.type: ILoggingTool
focal_class.var_name: logger
focal_class.file: tool/structgen/src/main/java/org/openscience/cdk/atomtype/StructGenMatcher.java
focal_class.identifier: StructGenMatcher
focal_class.interfaces: implements IAtomTypeMatcher
focal_class.class_method_signature: StructGenMatcher.StructGenMatcher()
focal_class.full_signature: public  StructGenMatcher()
focal_class.identifier: StructGenMatcher
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  StructGenMatcher()
focal_class.class_method_signature: StructGenMatcher.findMatchingAtomTypes(IAtomContainer atomContainer)
focal_class.full_signature: @Override public IAtomType[] findMatchingAtomTypes(IAtomContainer atomContainer)
focal_class.identifier: findMatchingAtomTypes
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainer atomContainer)
focal_class.return: IAtomType[]
focal_class.signature: IAtomType[] findMatchingAtomTypes(IAtomContainer atomContainer)
focal_class.class_method_signature: StructGenMatcher.findMatchingAtomType(IAtomContainer atomContainer, IAtom atom)
focal_class.full_signature: @Override public IAtomType findMatchingAtomType(IAtomContainer atomContainer, IAtom atom)
focal_class.identifier: findMatchingAtomType
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainer atomContainer, IAtom atom)
focal_class.return: IAtomType
focal_class.signature: IAtomType findMatchingAtomType(IAtomContainer atomContainer, IAtom atom)
focal_method.body: @Override
      public IAtomType findMatchingAtomType(IAtomContainer atomContainer, IAtom atom) throws CDKException {
          if (factory == null) {
              try {
                  factory = AtomTypeFactory.getInstance("org/openscience/cdk/config/data/structgen_atomtypes.xml",
                          atom.getBuilder());
              } catch (Exception ex1) {
                  logger.error(ex1.getMessage());
                  logger.debug(ex1);
                  throw new CDKException("Could not instantiate the AtomType list!", ex1);
              }
          }
  
          double bondOrderSum = atomContainer.getBondOrderSum(atom);
          IBond.Order maxBondOrder = atomContainer.getMaximumBondOrder(atom);
          int charge = atom.getFormalCharge();
          int hcount = atom.getImplicitHydrogenCount() == null ? 0 : atom.getImplicitHydrogenCount();
  
          IAtomType[] types = factory.getAtomTypes(atom.getSymbol());
          for (IAtomType type : types) {
              logger.debug("   ... matching atom ", atom, " vs ", type);
              if (bondOrderSum - charge + hcount == type.getBondOrderSum()
                      && !BondManipulator.isHigherOrder(maxBondOrder, type.getMaxBondOrder())) {
                  return type;
              }
          }
          logger.debug("    No Match");
  
          return null;
      }
focal_method.class_method_signature: StructGenMatcher.findMatchingAtomType(IAtomContainer atomContainer, IAtom atom)
focal_method.full_signature: @Override public IAtomType findMatchingAtomType(IAtomContainer atomContainer, IAtom atom)
focal_method.identifier: findMatchingAtomType
focal_method.invocations: getInstance getBuilder error getMessage debug getBondOrderSum getMaximumBondOrder getFormalCharge getImplicitHydrogenCount getImplicitHydrogenCount getAtomTypes getSymbol debug getBondOrderSum isHigherOrder getMaxBondOrder debug
focal_method.modifiers: @Override public
focal_method.parameters: (IAtomContainer atomContainer, IAtom atom)
focal_method.return: IAtomType
focal_method.signature: IAtomType findMatchingAtomType(IAtomContainer atomContainer, IAtom atom)