Class ChargeRule
java.lang.Object
org.openscience.cdk.formula.rules.ChargeRule
- All Implemented Interfaces:
IRule
This class validate if the charge in the IMolecularFormula correspond with
a specific value. As default it is defined as neutral == 0.0.
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObject[]
Gets the parameters attribute of the ChargeRule object.void
setParameters
(Object[] params) Sets the parameters attribute of the ChargeRule object.double
validate
(IMolecularFormula formula) Validate the charge of this IMolecularFormula.
-
Constructor Details
-
ChargeRule
public ChargeRule()Constructor for the ChargeRule object.
-
-
Method Details
-
setParameters
Sets the parameters attribute of the ChargeRule object.- Specified by:
setParameters
in interfaceIRule
- Parameters:
params
- The new parameters value- Throws:
CDKException
- Description of the Exception- See Also:
-
getParameters
Gets the parameters attribute of the ChargeRule object.- Specified by:
getParameters
in interfaceIRule
- Returns:
- The parameters value
- See Also:
-
validate
Validate the charge of this IMolecularFormula.- Specified by:
validate
in interfaceIRule
- 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
-