Class AdductFormula

    • Constructor Detail

      • AdductFormula

        public AdductFormula​(IMolecularFormula formula)
        Constructs an AdductFormula with a copy AdductFormula of another AdductFormula (A shallow copy, i.e., with the same objects as in the original AdductFormula).
        Parameters:
        formula - An MolecularFormula to copy from
        See Also:
        AdductFormula()
    • Method Detail

      • add

        public void add​(IMolecularFormulaSet formulaSet)
        Adds all molecularFormulas in the AdductFormula to this chemObject.
        Specified by:
        add in interface IMolecularFormulaSet
        Parameters:
        formulaSet - The MolecularFormulaSet
      • contains

        public boolean contains​(IIsotope isotope)
        True, if the AdductFormula contains the given IIsotope object and not the instance. The method looks for other isotopes which has the same symbol, natural abundance and exact mass.
        Specified by:
        contains in interface IAdductFormula
        Parameters:
        isotope - The IIsotope this AdductFormula is searched for
        Returns:
        True, if the AdductFormula contains the given isotope object
      • getIsotopeCount

        public int getIsotopeCount​(IIsotope isotope)
        Checks a set of Nodes for the occurrence of the isotope in the adduct formula from a particular isotope. It returns 0 if the does not exist.
        Specified by:
        getIsotopeCount in interface IAdductFormula
        Parameters:
        isotope - The IIsotope to look for
        Returns:
        The occurrence of this isotope in this adduct
        See Also:
        getIsotopeCount()
      • getIsotopeCount

        public int getIsotopeCount()
        Checks a set of Nodes for the number of different isotopes in the adduct formula.
        Specified by:
        getIsotopeCount in interface IAdductFormula
        Returns:
        The the number of different isotopes in this adduct formula
        See Also:
        getIsotopeCount(IIsotope)
      • isotopes

        public Iterable<IIsotope> isotopes()
        Returns an Iterator for looping over all isotopes in this adduct formula.
        Specified by:
        isotopes in interface IAdductFormula
        Returns:
        An Iterator with the isotopes in this adduct formula
      • setCharge

        public void setCharge​(Integer charge)
        Deprecated.
        No use this method. The charge is defined in each IMolecularFormula.
        Specified by:
        setCharge in interface IAdductFormula
        Parameters:
        charge - The partial charge
        See Also:
        getCharge()
      • size

        public int size()
        Returns the number of MolecularFormulas in this AdductFormula.
        Specified by:
        size in interface IMolecularFormulaSet
        Returns:
        The number of MolecularFormulas in this AdductFormula
      • contains

        public boolean contains​(IMolecularFormula formula)
        True, if the AdductFormula contains the given IMolecularFormula object.
        Specified by:
        contains in interface IMolecularFormulaSet
        Parameters:
        formula - The IMolecularFormula this AdductFormula is searched for
        Returns:
        True, if the AdductFormula contains the given IMolecularFormula object
      • getMolecularFormula

        public IMolecularFormula getMolecularFormula​(int position)
        Returns the MolecularFormula at position number in the chemObject.
        Specified by:
        getMolecularFormula in interface IMolecularFormulaSet
        Parameters:
        position - The position of the IMolecularFormula to be returned.
        Returns:
        The IMolecularFormula at position number .
      • removeMolecularFormula

        public void removeMolecularFormula​(IMolecularFormula formula)
        Removes an IMolecularFormula from this chemObject.
        Specified by:
        removeMolecularFormula in interface IMolecularFormulaSet
        Parameters:
        formula - The IMolecularFormula to be removed from this chemObject
      • removeMolecularFormula

        public void removeMolecularFormula​(int position)
        Removes an MolecularFormula from this chemObject.
        Specified by:
        removeMolecularFormula in interface IMolecularFormulaSet
        Parameters:
        position - The position of the MolecularFormula to be removed from this chemObject