Class ChargeRule

  • All Implemented Interfaces:
    IRule

    public class ChargeRule
    extends Object
    implements IRule
    This class validate if the charge in the IMolecularFormula correspond with a specific value. As default it is defined as neutral == 0.0.
    Table 1: Parameters set by this rule.
    Name Default Description
    charge 0.0 The Charge of MolecularFormula
    Author:
    miguelrojasch
    Source code:
    main
    Belongs to CDK module:
    formula
    Created on:
    2007-11-20
    • Constructor Detail

      • ChargeRule

        public ChargeRule()
        Constructor for the ChargeRule object.
    • Method Detail

      • validate

        public double validate​(IMolecularFormula formula)
                        throws CDKException
        Validate the charge of this IMolecularFormula.
        Specified by:
        validate in interface IRule
        Parameters:
        formula - Parameter is the IMolecularFormula
        Returns:
        A double value meaning 1.0 True, 0.0 False
        Throws:
        CDKException - if an error occurs during the validation. See documentation for individual rules