Package org.openscience.cdk.formula
Class MolecularFormulaChecker
- java.lang.Object
-
- org.openscience.cdk.formula.MolecularFormulaChecker
-
public class MolecularFormulaChecker extends Object
Validate a molecular formula given in IMolecularformula object. The validation is based according different rules that you have to introduce before see IRule.
-
-
Constructor Summary
Constructors Constructor Description MolecularFormulaChecker(List<IRule> rules)
Construct an instance of MolecularFormulaChecker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<IRule>
getRules()
Get the IRules to be applied to validate the IMolecularFormula.IMolecularFormula
isValid(IMolecularFormula formula)
Validate if a IMolecularFormula is valid.Double
isValidSum(IMolecularFormula formula)
Validate if a IMolecularFormula is valid.
-
-
-
Method Detail
-
getRules
public List<IRule> getRules()
Get the IRules to be applied to validate the IMolecularFormula.- Returns:
- A List with IRule
-
isValidSum
public Double isValidSum(IMolecularFormula formula)
Validate if a IMolecularFormula is valid. The result more close to 1 means maximal probability to be valid. Opposite more close to 0 means minimal probability to be valid. To know the result in each IRule useisValid(IMolecularFormula)
- Parameters:
formula
- The IMolecularFormula value- Returns:
- The percent of the validity
- See Also:
isValid(IMolecularFormula)
-
isValid
public IMolecularFormula isValid(IMolecularFormula formula)
Validate if a IMolecularFormula is valid. The results of each IRule which has to be applied is put into IMolecularFormula as properties. To extract the result final as the product of rule's result useisValidSum(IMolecularFormula)
.- Parameters:
formula
- The IMolecularFormula value- Returns:
- formulaWith The IMolecularFormula with the results for each IRule into properties
- See Also:
isValidSum(IMolecularFormula)
-
-