Class MolecularFormulaRange

  • All Implemented Interfaces:
    Cloneable

    public class MolecularFormulaRange
    extends Object
    implements 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 Detail

      • MolecularFormulaRange

        public MolecularFormulaRange()
        Constructs an empty MolecularFormulaExpand.
    • Method Detail

      • addIsotope

        public void addIsotope​(IIsotope isotope,
                               int countMin,
                               int countMax)
        Adds an Isotope to this MolecularFormulaExpand in a number of maximum and minimum occurrences allowed.
        Parameters:
        isotope - The isotope to be added to this MolecularFormulaExpand
        countMax - The maximal number of occurrences to add
        countMin - The minimal number of occurrences to add
      • contains

        public boolean contains​(IIsotope isotope)
        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

        public int getIsotopeCountMax​(IIsotope isotope)
        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

        public int getIsotopeCountMin​(IIsotope isotope)
        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

        public Iterable<IIsotope> 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

        public void removeIsotope​(IIsotope isotope)
        Removes the given isotope from the MolecularFormulaExpand.
        Parameters:
        isotope - The IIsotope to be removed