Interface IRule

All Known Implementing Classes:
ChargeRule, ElementRule, IsotopePatternRule, MMElementRule, NitrogenRule, RDBERule, ToleranceRangeRule

public interface IRule
Interface which groups all method that validate a IMolecularFormula.
Author:
miguelrojasch
Source code:
main
Belongs to CDK module:
formula
Created on:
2007-11-20
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the current parameter values.
    void
    Sets the parameters for this rule.
    double
    Analyze the validity for the given IMolecularFormula.
  • Method Details

    • setParameters

      void setParameters(Object[] params) throws CDKException
      Sets the parameters for this rule. Must be done before calling calculate as the parameters influence the validation outcome.
      Parameters:
      params - An array of Object containing the parameters for this rule
      Throws:
      CDKException - if invalid number of type of parameters are passed to it
      See Also:
    • getParameters

      Object[] getParameters()
      Returns the current parameter values.
      Returns:
      An array of Object containing the parameter values
      See Also:
    • validate

      double validate(IMolecularFormula formula) throws CDKException
      Analyze the validity for the given IMolecularFormula.
      Parameters:
      formula - An IMolecularFormula for which this rule should be analyzed
      Returns:
      A double value between 0 and 1. 1 meaning 100% valid and 0 not valid
      Throws:
      CDKException - if an error occurs during the validation. See documentation for individual rules