public class AdductFormula extends Object implements Iterable<IMolecularFormula>, IAdductFormula, Cloneable
Examples:
[C2H4O2+Na]+
Constructor and Description |
---|
AdductFormula()
Constructs an empty AdductFormula.
|
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).
|
Modifier and Type | Method and Description |
---|---|
void |
add(IMolecularFormulaSet formulaSet)
Adds all molecularFormulas in the AdductFormula to this chemObject.
|
void |
addMolecularFormula(IMolecularFormula formula)
Adds an molecularFormula to this chemObject.
|
Object |
clone()
Clones this AdductFormula object and its content.
|
boolean |
contains(IIsotope isotope)
True, if the AdductFormula contains the given IIsotope object and not
the instance.
|
boolean |
contains(IMolecularFormula formula)
True, if the AdductFormula contains the given IMolecularFormula object.
|
IChemObjectBuilder |
getBuilder()
Returns a
IChemObjectBuilder for the data classes that extend
this class. |
Integer |
getCharge()
Returns the partial charge of this Adduct.
|
int |
getIsotopeCount()
Checks a set of Nodes for the number of different isotopes in the
adduct formula.
|
int |
getIsotopeCount(IIsotope isotope)
Checks a set of Nodes for the occurrence of the isotope in the
adduct formula from a particular isotope.
|
IMolecularFormula |
getMolecularFormula(int position)
Returns the MolecularFormula at position
number in the
chemObject. |
Iterable<IIsotope> |
isotopes()
Returns an Iterator for looping over all isotopes in this adduct formula.
|
Iterator<IMolecularFormula> |
iterator()
Returns an Iterator for looping over all IMolecularFormula
in this adduct formula.
|
Iterable<IMolecularFormula> |
molecularFormulas()
Returns an Iterable for looping over all IMolecularFormula
in this adduct formula.
|
void |
removeAllMolecularFormulas()
Removes all IMolecularFormula from this chemObject.
|
void |
removeMolecularFormula(IMolecularFormula formula)
Removes an IMolecularFormula from this chemObject.
|
void |
removeMolecularFormula(int position)
Removes an MolecularFormula from this chemObject.
|
void |
setCharge(Integer charge)
Deprecated.
|
int |
size()
Returns the number of MolecularFormulas in this AdductFormula.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public AdductFormula()
AdductFormula(IMolecularFormula)
public AdductFormula(IMolecularFormula formula)
formula
- An MolecularFormula to copy fromAdductFormula()
public void addMolecularFormula(IMolecularFormula formula)
addMolecularFormula
in interface IMolecularFormulaSet
formula
- The molecularFormula to be added to this chemObjectpublic void add(IMolecularFormulaSet formulaSet)
add
in interface IMolecularFormulaSet
formulaSet
- The MolecularFormulaSetpublic boolean contains(IIsotope isotope)
contains
in interface IAdductFormula
isotope
- The IIsotope this AdductFormula is searched forpublic Integer getCharge()
getCharge
in interface IAdductFormula
setCharge(java.lang.Integer)
public int getIsotopeCount(IIsotope isotope)
getIsotopeCount
in interface IAdductFormula
isotope
- The IIsotope to look forgetIsotopeCount()
public int getIsotopeCount()
getIsotopeCount
in interface IAdductFormula
getIsotopeCount(IIsotope)
public Iterable<IIsotope> isotopes()
isotopes
in interface IAdductFormula
public void setCharge(Integer charge)
setCharge
in interface IAdductFormula
charge
- The partial chargegetCharge()
public Iterable<IMolecularFormula> molecularFormulas()
molecularFormulas
in interface IMolecularFormulaSet
IMolecularFormulaSet.addMolecularFormula(IMolecularFormula)
public Iterator<IMolecularFormula> iterator()
iterator
in interface Iterable<IMolecularFormula>
public int size()
size
in interface IMolecularFormulaSet
public boolean contains(IMolecularFormula formula)
contains
in interface IMolecularFormulaSet
formula
- The IMolecularFormula this AdductFormula is searched forpublic IMolecularFormula getMolecularFormula(int position)
number
in the
chemObject.getMolecularFormula
in interface IMolecularFormulaSet
position
- The position of the IMolecularFormula to be returned.number
.public void removeAllMolecularFormulas()
removeAllMolecularFormulas
in interface IMolecularFormulaSet
public void removeMolecularFormula(IMolecularFormula formula)
removeMolecularFormula
in interface IMolecularFormulaSet
formula
- The IMolecularFormula to be removed from this chemObjectpublic void removeMolecularFormula(int position)
removeMolecularFormula
in interface IMolecularFormulaSet
position
- The position of the MolecularFormula to be removed from this chemObjectpublic Object clone() throws CloneNotSupportedException
clone
in interface IAdductFormula
clone
in interface IMolecularFormulaSet
clone
in class Object
CloneNotSupportedException
public IChemObjectBuilder getBuilder()
ICDKObject
IChemObjectBuilder
for the data classes that extend
this class.getBuilder
in interface ICDKObject
IChemObjectBuilder
matching this ICDKObject
Copyright © 2021. All rights reserved.