Class 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.

    Author:
    miguelrojasch
    See Also:
    IRule
    Source code:
    main
    Belongs to CDK module:
    formula
    Keywords:
    molecule, molecular formula
    Created on:
    2007-11-20
    • Constructor Detail

      • MolecularFormulaChecker

        public MolecularFormulaChecker​(List<IRule> rules)
        Construct an instance of MolecularFormulaChecker. It must be initialized with the rules to applied.
        Parameters:
        rules - A List with IRule to be applied
    • 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 use isValid(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 use isValidSum(IMolecularFormula).
        Parameters:
        formula - The IMolecularFormula value
        Returns:
        formulaWith The IMolecularFormula with the results for each IRule into properties
        See Also:
        isValidSum(IMolecularFormula)