Class ElementRule

java.lang.Object
org.openscience.cdk.formula.rules.ElementRule
All Implemented Interfaces:
IRule

public class ElementRule extends Object implements IRule
This class validate if the occurrence of the IElements in the IMolecularFormula are into a limits. As default defines all elements of the periodic table with a occurrence of zero to 100.
Table 1: Parameters set by this rule.
Name Default Description
elements C,H,N,O The IELements to be analyzed
Author:
miguelrojasch
Source code:
main
Belongs to CDK module:
formula
Created on:
2007-11-20
  • Constructor Details

    • ElementRule

      public ElementRule()
      Constructor for the ElementRule object.
  • Method Details

    • setParameters

      public void setParameters(Object[] params) throws CDKException
      Sets the parameters attribute of the ElementRule object.
      Specified by:
      setParameters in interface IRule
      Parameters:
      params - The new parameters value
      Throws:
      CDKException - Description of the Exception
      See Also:
    • getParameters

      public Object[] getParameters()
      Gets the parameters attribute of the ElementRule object.
      Specified by:
      getParameters in interface IRule
      Returns:
      The parameters value
      See Also:
    • validate

      public double validate(IMolecularFormula formula) throws CDKException
      Validate the occurrence of this IMolecularFormula.
      Specified by:
      validate in interface IRule
      Parameters:
      formula - Parameter is the IMolecularFormula
      Returns:
      An ArrayList containing 9 elements in the order described above
      Throws:
      CDKException - if an error occurs during the validation. See documentation for individual rules