Class MolecularFormulaSetManipulator

java.lang.Object
org.openscience.cdk.tools.manipulator.MolecularFormulaSetManipulator

public class MolecularFormulaSetManipulator extends Object
Class with convenience methods that provide methods to manipulate MolecularFormulaSet's. For example:
  IMolecularFormula molecularFormula = MolecularManipulatorSet.getMaxOccurrenceElements(molecularFormulaSet);
 
.
Author:
miguelrojasch
Source code:
main
Belongs to CDK module:
formula
Created on:
2007-11-20
  • Constructor Details

    • MolecularFormulaSetManipulator

      public MolecularFormulaSetManipulator()
  • Method Details

    • getMaxOccurrenceElements

      public static IMolecularFormula getMaxOccurrenceElements(IMolecularFormulaSet mfSet)
      Extract from a set of MolecularFormula the maximum occurrence of each element found and put the element and occurrence in a new IMolecularFormula.
      Parameters:
      mfSet - The set of molecularFormules to inspect
      Returns:
      A IMolecularFormula containing the maximum occurrence of the elements
      See Also:
    • getMinOccurrenceElements

      public static IMolecularFormula getMinOccurrenceElements(IMolecularFormulaSet mfSet)
      Extract from a set of MolecularFormula the minimal occurrence of each element found and put the element and occurrence in a new IMolecularFormula.
      Parameters:
      mfSet - The set of molecularFormules to inspect
      Returns:
      A IMolecularFormula containing the minimal occurrence of the elements
      See Also:
    • remove

      public static IMolecularFormulaSet remove(IMolecularFormulaSet formulaSet, IMolecularFormula formulaMin, IMolecularFormula formulaMax)
      Remove all those IMolecularFormula which are not fit theirs IElement occurrence into a limits. The limits are given from formulaMax and formulaMin. In the minimal IMolecularFormula must contain all those IElement found in the minimal IMolecularFormula.
      Parameters:
      formulaSet - IMolecularFormulaSet to look for
      formulaMax - A IMolecularFormula which contains the maximal representation of the Elements
      formulaMin - A IMolecularFormula which contains the minimal representation of the Elements
      Returns:
      A IMolecularFormulaSet with only the IMolecularFormula which the IElements are into the correct occurrence
    • contains

      public static boolean contains(IMolecularFormulaSet formulaSet, IMolecularFormula formula)
      True, if the IMolecularFormulaSet contains the given IMolecularFormula but not as object. It compare according contains the same number and type of Isotopes. It is not based on compare objects.
      Parameters:
      formulaSet - The IMolecularFormulaSet
      formula - The IMolecularFormula this IMolecularFormulaSet is searched for
      Returns:
      True, if the IMolecularFormulaSet contains the given formula
      See Also:
    • remove

      public static IMolecularFormulaSet remove(IMolecularFormulaSet formulaSet, MolecularFormulaRange formulaRange)
      Remove all those IMolecularFormula which are not fit theirs IElement occurrence into a limits. The limits are given from formulaMax and formulaMin. In the minimal IMolecularFormula must contain all those IElement found in the minimal IMolecularFormula.
      Parameters:
      formulaSet - IMolecularFormulaSet to look for
      formulaRange - A IMolecularFormulaRange which contains the range representation of the IIsotope