test_class.declarator: builder = SilentChemObjectBuilder.getInstance()
test_class.modifier: private final static
test_class.original_string: private final static IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();
test_class.type: IChemObjectBuilder
test_class.var_name: builder
test_class.declarator: ifac
test_class.modifier: private
test_class.original_string: private IsotopeFactory                  ifac;
test_class.type: IsotopeFactory
test_class.var_name: ifac
test_class.file: tool/formula/src/test/java/org/openscience/cdk/formula/MolecularFormulaCheckerTest.java
test_class.identifier: MolecularFormulaCheckerTest
test_class.superclass: extends CDKTestCase
test_case.body: @Test
      public void testIsValid_NOT() {
  
          IMolecularFormula formula = new MolecularFormula();
          formula.addIsotope(ifac.getMajorIsotope("C"), 1);
          formula.addIsotope(ifac.getMajorIsotope("H"), 100);
  
          List<IRule> rules = new ArrayList<IRule>();
          rules.add(new MMElementRule());
  
          MolecularFormulaChecker MFChecker = new MolecularFormulaChecker(rules);
  
          IMolecularFormula formulaWith = MFChecker.isValid(formula);
  
          Assert.assertEquals(0.0d,
                              (double)formulaWith.getProperty((new MMElementRule()).getClass()),
                              0.01);
  
      }
test_case.class_method_signature: MolecularFormulaCheckerTest.testIsValid_NOT()
test_case.full_signature: @Test public void testIsValid_NOT()
test_case.identifier: testIsValid_NOT
test_case.invocations: addIsotope getMajorIsotope addIsotope getMajorIsotope add isValid assertEquals getProperty getClass
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testIsValid_NOT()
focal_class.declarator: logger = LoggingToolFactory.createLoggingTool(MolecularFormulaChecker.class)
focal_class.modifier: private
focal_class.original_string: private ILoggingTool logger = LoggingToolFactory.createLoggingTool(MolecularFormulaChecker.class);
focal_class.type: ILoggingTool
focal_class.var_name: logger
focal_class.declarator: rules
focal_class.modifier: private
focal_class.original_string: private List<IRule>  rules;
focal_class.type: List<IRule>
focal_class.var_name: rules
focal_class.file: tool/formula/src/main/java/org/openscience/cdk/formula/MolecularFormulaChecker.java
focal_class.identifier: MolecularFormulaChecker
focal_class.class_method_signature: MolecularFormulaChecker.MolecularFormulaChecker(List<IRule> rules)
focal_class.full_signature: public  MolecularFormulaChecker(List<IRule> rules)
focal_class.identifier: MolecularFormulaChecker
focal_class.modifiers: public
focal_class.parameters: (List<IRule> rules)
focal_class.signature:  MolecularFormulaChecker(List<IRule> rules)
focal_class.class_method_signature: MolecularFormulaChecker.getRules()
focal_class.full_signature: public List<IRule> getRules()
focal_class.identifier: getRules
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<IRule>
focal_class.signature: List<IRule> getRules()
focal_class.class_method_signature: MolecularFormulaChecker.isValidSum(IMolecularFormula formula)
focal_class.full_signature: public Double isValidSum(IMolecularFormula formula)
focal_class.identifier: isValidSum
focal_class.modifiers: public
focal_class.parameters: (IMolecularFormula formula)
focal_class.return: Double
focal_class.signature: Double isValidSum(IMolecularFormula formula)
focal_class.class_method_signature: MolecularFormulaChecker.isValid(IMolecularFormula formula)
focal_class.full_signature: public IMolecularFormula isValid(IMolecularFormula formula)
focal_class.identifier: isValid
focal_class.modifiers: public
focal_class.parameters: (IMolecularFormula formula)
focal_class.return: IMolecularFormula
focal_class.signature: IMolecularFormula isValid(IMolecularFormula formula)
focal_method.body: public IMolecularFormula isValid(IMolecularFormula formula) {
          logger.info("Generating the validity of the molecular formula");
  
          if (formula.getIsotopeCount() == 0) {
              logger.error("Proposed molecular formula has not elements");
              return formula;
          }
  
          Iterator<IRule> iterRules = rules.iterator();
          try {
              while (iterRules.hasNext()) {
                  IRule rule = iterRules.next();
                  double result = rule.validate(formula);
                  formula.setProperty(rule.getClass(), result);
  
              }
          } catch (CDKException e) {
              e.printStackTrace();
          }
  
          return formula;
      }
focal_method.class_method_signature: MolecularFormulaChecker.isValid(IMolecularFormula formula)
focal_method.full_signature: public IMolecularFormula isValid(IMolecularFormula formula)
focal_method.identifier: isValid
focal_method.invocations: info getIsotopeCount error iterator hasNext next validate setProperty getClass printStackTrace
focal_method.modifiers: public
focal_method.parameters: (IMolecularFormula formula)
focal_method.return: IMolecularFormula
focal_method.signature: IMolecularFormula isValid(IMolecularFormula formula)