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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object[]
getParameters()
Returns the current parameter values.void
setParameters(Object[] params)
Sets the parameters for this rule.double
validate(IMolecularFormula formula)
Analyze the validity for the given IMolecularFormula.
-
-
-
Method Detail
-
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()
-
getParameters
Object[] getParameters()
Returns the current parameter values.- Returns:
- An array of Object containing the parameter values
- See Also:
setParameters(java.lang.Object[])
-
validate
double validate(IMolecularFormula formula) throws CDKException
Analyze the validity for the given IMolecularFormula.- Parameters:
formula
- AnIMolecularFormula
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
-
-