Class MolecularFormulaRange

java.lang.Object
org.openscience.cdk.formula.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 Summary

    Constructors
    Constructor
    Description
    Constructs an empty MolecularFormulaExpand.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addIsotope(IIsotope isotope, int countMin, int countMax)
    Adds an Isotope to this MolecularFormulaExpand in a number of maximum and minimum occurrences allowed.
    Clones this MolecularFormulaExpand object and its content.
    boolean
    contains(IIsotope isotope)
    True, if the MolecularFormulaExpand contains the given IIsotope.
    int
    Checks a set of Nodes for the number of different isotopes in the MolecularFormulaExpand.
    int
    Checks a set of Nodes for the maximal occurrence of the isotope in the MolecularFormulaExpand from a particular isotope.
    int
    Checks a set of Nodes for the minimal occurrence of the isotope in the MolecularFormulaExpand from a particular isotope.
    Returns an Iterator for looping over all isotopes in this MolecularFormulaExpand.
    void
    Removes all isotopes of this molecular formula.
    void
    Removes the given isotope from the MolecularFormulaExpand.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MolecularFormulaRange

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

    • 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
    • clone

      public Object clone() throws CloneNotSupportedException
      Clones this MolecularFormulaExpand object and its content. I should integrate into ChemObject.
      Overrides:
      clone in class Object
      Returns:
      The cloned object
      Throws:
      CloneNotSupportedException