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 Summary
Constructors Constructor Description ElementRule()
Constructor for the ElementRule object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]
getParameters()
Gets the parameters attribute of the ElementRule object.void
setParameters(Object[] params)
Sets the parameters attribute of the ElementRule object.double
validate(IMolecularFormula formula)
Validate the occurrence of this IMolecularFormula.
-
-
-
Method Detail
-
setParameters
public void setParameters(Object[] params) throws CDKException
Sets the parameters attribute of the ElementRule object.- Specified by:
setParameters
in interfaceIRule
- Parameters:
params
- The new parameters value- Throws:
CDKException
- Description of the Exception- See Also:
getParameters()
-
getParameters
public Object[] getParameters()
Gets the parameters attribute of the ElementRule object.- Specified by:
getParameters
in interfaceIRule
- Returns:
- The parameters value
- See Also:
setParameters(java.lang.Object[])
-
validate
public double validate(IMolecularFormula formula) throws CDKException
Validate the occurrence of this IMolecularFormula.- Specified by:
validate
in interfaceIRule
- 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
-
-