test_class.declarator: builder
test_class.modifier: private static
test_class.original_string: private static IChemObjectBuilder builder;
test_class.type: IChemObjectBuilder
test_class.var_name: builder
test_class.file: tool/formula/src/test/java/org/openscience/cdk/formula/rules/ToleranceRangeRuleTest.java
test_class.identifier: ToleranceRangeRuleTest
test_class.superclass: extends FormulaRuleTest
test_case.body: @Test
      public void testDefaultValidFalse() throws Exception {
  
          IRule rule = new ToleranceRangeRule();
  
          IMolecularFormula formula = new MolecularFormula();
          IIsotope carb = builder.newInstance(IIsotope.class, "C");
          carb.setExactMass(12.00);
          IIsotope cl = builder.newInstance(IIsotope.class, "Cl");
          cl.setExactMass(34.96885268);
          formula.addIsotope(carb);
          formula.addIsotope(cl);
  
          Assert.assertEquals(0.0, rule.validate(formula), 0.0001);
      }
test_case.class_method_signature: ToleranceRangeRuleTest.testDefaultValidFalse()
test_case.full_signature: @Test public void testDefaultValidFalse()
test_case.identifier: testDefaultValidFalse
test_case.invocations: newInstance setExactMass newInstance setExactMass addIsotope addIsotope assertEquals validate
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDefaultValidFalse()
focal_class.declarator: logger    = LoggingToolFactory.createLoggingTool(ToleranceRangeRule.class)
focal_class.modifier: private static
focal_class.original_string: private static ILoggingTool logger    = LoggingToolFactory.createLoggingTool(ToleranceRangeRule.class);
focal_class.type: ILoggingTool
focal_class.var_name: logger
focal_class.declarator: mass      = 0.0
focal_class.modifier: private
focal_class.original_string: private double              mass      = 0.0;
focal_class.type: double
focal_class.var_name: mass
focal_class.declarator: tolerance = 0.05
focal_class.modifier: private
focal_class.original_string: private double              tolerance = 0.05;
focal_class.type: double
focal_class.var_name: tolerance
focal_class.file: tool/formula/src/main/java/org/openscience/cdk/formula/rules/ToleranceRangeRule.java
focal_class.identifier: ToleranceRangeRule
focal_class.interfaces: implements IRule
focal_class.class_method_signature: ToleranceRangeRule.ToleranceRangeRule()
focal_class.full_signature: public  ToleranceRangeRule()
focal_class.identifier: ToleranceRangeRule
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  ToleranceRangeRule()
focal_class.class_method_signature: ToleranceRangeRule.setParameters(Object[] params)
focal_class.full_signature: @Override public void setParameters(Object[] params)
focal_class.identifier: setParameters
focal_class.modifiers: @Override public
focal_class.parameters: (Object[] params)
focal_class.return: void
focal_class.signature: void setParameters(Object[] params)
focal_class.class_method_signature: ToleranceRangeRule.getParameters()
focal_class.full_signature: @Override public Object[] getParameters()
focal_class.identifier: getParameters
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Object[]
focal_class.signature: Object[] getParameters()
focal_class.class_method_signature: ToleranceRangeRule.validate(IMolecularFormula formula)
focal_class.full_signature: @Override public double validate(IMolecularFormula formula)
focal_class.identifier: validate
focal_class.modifiers: @Override public
focal_class.parameters: (IMolecularFormula formula)
focal_class.return: double
focal_class.signature: double validate(IMolecularFormula formula)
focal_method.body: @Override
      public double validate(IMolecularFormula formula) throws CDKException {
          logger.info("Start validation of ", formula);
  
          double totalExactMass = MolecularFormulaManipulator.getTotalExactMass(formula);
  
          if (Math.abs(totalExactMass - mass) > tolerance)
              return 0.0;
          else
              return 1.0;
      }
focal_method.class_method_signature: ToleranceRangeRule.validate(IMolecularFormula formula)
focal_method.full_signature: @Override public double validate(IMolecularFormula formula)
focal_method.identifier: validate
focal_method.invocations: info getTotalExactMass abs
focal_method.modifiers: @Override public
focal_method.parameters: (IMolecularFormula formula)
focal_method.return: double
focal_method.signature: double validate(IMolecularFormula formula)