Class NitrogenRule
- java.lang.Object
-
- org.openscience.cdk.formula.rules.NitrogenRule
-
- All Implemented Interfaces:
IRule
public class NitrogenRule extends Object implements IRule
This class validate if the rule of nitrogen is kept.If a compound has an odd number of nitrogen atoms, then the molecular ion (the [M]+) will have an odd mass and the value for m/e will be odd.
If a compound has no nitrogen atom or an even number of nitrogen atoms, then the m/e value of [M]+ will be even.
Table 1: Parameters set by this rule. Name Default Description charge 0.0 The Nitrogen rule of MolecularFormula - Author:
- miguelrojasch
- Source code:
- main
- Belongs to CDK module:
- formula
- Created on:
- 2008-06-11
-
-
Constructor Summary
Constructors Constructor Description NitrogenRule()
Constructor for the NitrogenRule object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]
getParameters()
Gets the parameters attribute of the NitrogenRule object.void
setParameters(Object[] params)
Sets the parameters attribute of the NitrogenRule object.double
validate(IMolecularFormula formula)
Validate the nitrogen rule of this IMolecularFormula.
-
-
-
Method Detail
-
setParameters
public void setParameters(Object[] params) throws CDKException
Sets the parameters attribute of the NitrogenRule object.- Specified by:
setParameters
in interfaceIRule
- Parameters:
params
- The new parameters value- Throws:
CDKException
- Description of the Exception- See Also:
getParameters()
-
getParameters
public Object[] getParameters()
Gets the parameters attribute of the NitrogenRule object.- Specified by:
getParameters
in interfaceIRule
- Returns:
- The parameters value
- See Also:
setParameters(java.lang.Object[])
-
validate
public double validate(IMolecularFormula formula) throws CDKException
Validate the nitrogen rule 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
-
-