Package org.openscience.cdk.formula
Class MolecularFormulaRange
java.lang.Object
org.openscience.cdk.formula.MolecularFormulaRange
- All Implemented Interfaces:
Cloneable
Class defining a expanded molecular formula object. The Isotopes don't have
a fix occurrence in the MolecularFormula but they have a range.
With this class man can define a MolecularFormula which contains certain IIsotope with a maximum and minimum occurrence. Examples:
[C(1-5)H(4-10)]-
- Author:
- miguelrojasch
- Source code:
- main
- Belongs to CDK module:
- formula
- Keywords:
- molecular formula
- Created on:
- 2007-11-20
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIsotope
(IIsotope isotope, int countMin, int countMax) Adds an Isotope to this MolecularFormulaExpand in a number of maximum and minimum occurrences allowed.clone()
Clones this MolecularFormulaExpand object and its content.boolean
True, if the MolecularFormulaExpand contains the given IIsotope.int
Checks a set of Nodes for the number of different isotopes in the MolecularFormulaExpand.int
getIsotopeCountMax
(IIsotope isotope) Checks a set of Nodes for the maximal occurrence of the isotope in the MolecularFormulaExpand from a particular isotope.int
getIsotopeCountMin
(IIsotope isotope) Checks a set of Nodes for the minimal occurrence of the isotope in the MolecularFormulaExpand from a particular isotope.isotopes()
Returns an Iterator for looping over all isotopes in this MolecularFormulaExpand.void
Removes all isotopes of this molecular formula.void
removeIsotope
(IIsotope isotope) Removes the given isotope from the MolecularFormulaExpand.
-
Constructor Details
-
MolecularFormulaRange
public MolecularFormulaRange()Constructs an empty MolecularFormulaExpand.
-
-
Method Details
-
addIsotope
Adds an Isotope to this MolecularFormulaExpand in a number of maximum and minimum occurrences allowed.- Parameters:
isotope
- The isotope to be added to this MolecularFormulaExpandcountMax
- The maximal number of occurrences to addcountMin
- The minimal number of occurrences to add
-
contains
True, if the MolecularFormulaExpand contains the given IIsotope. The method looks for other isotopes which has the same symbol, natural abundance and exact mass.- Parameters:
isotope
- The IIsotope this MolecularFormula is searched for- Returns:
- True, if the MolecularFormula contains the given isotope object
-
getIsotopeCountMax
Checks a set of Nodes for the maximal occurrence of the isotope in the MolecularFormulaExpand from a particular isotope. It returns -1 if the Isotope does not exist.- Parameters:
isotope
- The IIsotope to look for- Returns:
- The occurrence of this isotope in this IMolecularFormula
-
getIsotopeCountMin
Checks a set of Nodes for the minimal occurrence of the isotope in the MolecularFormulaExpand from a particular isotope. It returns -1 if the Isotope does not exist.- Parameters:
isotope
- The IIsotope to look for- Returns:
- The occurrence of this isotope in this IMolecularFormula
-
getIsotopeCount
public int getIsotopeCount()Checks a set of Nodes for the number of different isotopes in the MolecularFormulaExpand.- Returns:
- The the number of different isotopes in this MolecularFormulaExpand
-
isotopes
Returns an Iterator for looping over all isotopes in this MolecularFormulaExpand.- Returns:
- An Iterator with the isotopes in this MolecularFormulaExpand
-
removeAllIsotopes
public void removeAllIsotopes()Removes all isotopes of this molecular formula. -
removeIsotope
Removes the given isotope from the MolecularFormulaExpand.- Parameters:
isotope
- The IIsotope to be removed
-
clone
Clones this MolecularFormulaExpand object and its content. I should integrate into ChemObject.- Overrides:
clone
in classObject
- Returns:
- The cloned object
- Throws:
CloneNotSupportedException
-