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 testIsValidSum_True_2Rules() {
  
          IMolecularFormula formula = new MolecularFormula();
          formula.addIsotope(ifac.getMajorIsotope("C"), 1);
          formula.addIsotope(ifac.getMajorIsotope("H"), 4);
          formula.setCharge(0);
  
          List<IRule> rules = new ArrayList<IRule>();
          rules.add(new MMElementRule());
          rules.add(new ChargeRule());
  
          MolecularFormulaChecker MFChecker = new MolecularFormulaChecker(rules);
  
          Assert.assertEquals(1.0, MFChecker.isValidSum(formula), 0.001);
  
      }
test_case.class_method_signature: MolecularFormulaCheckerTest.testIsValidSum_True_2Rules()
test_case.full_signature: @Test public void testIsValidSum_True_2Rules()
test_case.identifier: testIsValidSum_True_2Rules
test_case.invocations: addIsotope getMajorIsotope addIsotope getMajorIsotope setCharge add add assertEquals isValidSum
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testIsValidSum_True_2Rules()
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 Double isValidSum(IMolecularFormula formula) {
          double result = 1.0;
  
          IMolecularFormula formulaWith = isValid(formula);
          Map<Object, Object> properties = formulaWith.getProperties();
  
          Iterator<IRule> iterRules = rules.iterator();
          while (iterRules.hasNext()) {
              result *= (Double) properties.get(iterRules.next().getClass());
          }
          return result;
      }
focal_method.class_method_signature: MolecularFormulaChecker.isValidSum(IMolecularFormula formula)
focal_method.full_signature: public Double isValidSum(IMolecularFormula formula)
focal_method.identifier: isValidSum
focal_method.invocations: isValid getProperties iterator hasNext get getClass next
focal_method.modifiers: public
focal_method.parameters: (IMolecularFormula formula)
focal_method.return: Double
focal_method.signature: Double isValidSum(IMolecularFormula formula)