Package org.openscience.cdk.debug
Class DebugAdductFormula
- java.lang.Object
-
- org.openscience.cdk.formula.AdductFormula
-
- org.openscience.cdk.debug.DebugAdductFormula
-
- All Implemented Interfaces:
Cloneable
,Iterable<IMolecularFormula>
,IAdductFormula
,ICDKObject
,IMolecularFormulaSet
public class DebugAdductFormula extends AdductFormula implements IAdductFormula
Debugging implementation ofIAdductFormula
.- Source code:
- main
- Belongs to CDK module:
- datadebug
-
-
Constructor Summary
Constructors Constructor Description DebugAdductFormula()
DebugAdductFormula(IMolecularFormula formula)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(IMolecularFormulaSet formulaSet)
Adds all molecularFormulas in the AdductFormula to this chemObject.void
addMolecularFormula(IMolecularFormula formula)
Adds an molecularFormula to this chemObject.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 aIChemObjectBuilder
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 positionnumber
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(int position)
Removes an MolecularFormula from this chemObject.void
removeMolecularFormula(IMolecularFormula formula)
Removes an IMolecularFormula from this chemObject.void
setCharge(Integer charge)
No use this method.int
size()
Returns the number of MolecularFormulas in this AdductFormula.-
Methods inherited from class org.openscience.cdk.formula.AdductFormula
clone
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openscience.cdk.interfaces.IAdductFormula
clone
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
DebugAdductFormula
public DebugAdductFormula()
-
DebugAdductFormula
public DebugAdductFormula(IMolecularFormula formula)
-
-
Method Detail
-
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 interfaceIAdductFormula
- Overrides:
contains
in classAdductFormula
- Parameters:
isotope
- The IIsotope this AdductFormula is searched for- Returns:
- True, if the AdductFormula contains the given isotope object
-
getCharge
public Integer getCharge()
Returns the partial charge of this Adduct. If the charge has not been set the return value is Double.NaN.- Specified by:
getCharge
in interfaceIAdductFormula
- Overrides:
getCharge
in classAdductFormula
- Returns:
- the charge of this Adduct
- See Also:
AdductFormula.setCharge(java.lang.Integer)
-
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 interfaceIAdductFormula
- Overrides:
getIsotopeCount
in classAdductFormula
- Parameters:
isotope
- The IIsotope to look for- Returns:
- The occurrence of this isotope in this adduct
- See Also:
AdductFormula.getIsotopeCount()
-
getIsotopeCount
public int getIsotopeCount()
Checks a set of Nodes for the number of different isotopes in the adduct formula.- Specified by:
getIsotopeCount
in interfaceIAdductFormula
- Overrides:
getIsotopeCount
in classAdductFormula
- Returns:
- The the number of different isotopes in this adduct formula
- See Also:
AdductFormula.getIsotopeCount(IIsotope)
-
isotopes
public Iterable<IIsotope> isotopes()
Returns an Iterator for looping over all isotopes in this adduct formula.- Specified by:
isotopes
in interfaceIAdductFormula
- Overrides:
isotopes
in classAdductFormula
- Returns:
- An Iterator with the isotopes in this adduct formula
-
setCharge
public void setCharge(Integer charge)
No use this method. The charge is defined in each IMolecularFormula.- Specified by:
setCharge
in interfaceIAdductFormula
- Overrides:
setCharge
in classAdductFormula
- Parameters:
charge
- The partial charge- See Also:
AdductFormula.getCharge()
-
add
public void add(IMolecularFormulaSet formulaSet)
Adds all molecularFormulas in the AdductFormula to this chemObject.- Specified by:
add
in interfaceIMolecularFormulaSet
- Overrides:
add
in classAdductFormula
- Parameters:
formulaSet
- The MolecularFormulaSet
-
addMolecularFormula
public void addMolecularFormula(IMolecularFormula formula)
Adds an molecularFormula to this chemObject.- Specified by:
addMolecularFormula
in interfaceIMolecularFormulaSet
- Overrides:
addMolecularFormula
in classAdductFormula
- Parameters:
formula
- The molecularFormula to be added to this chemObject
-
contains
public boolean contains(IMolecularFormula formula)
True, if the AdductFormula contains the given IMolecularFormula object.- Specified by:
contains
in interfaceIMolecularFormulaSet
- Overrides:
contains
in classAdductFormula
- 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 positionnumber
in the chemObject.- Specified by:
getMolecularFormula
in interfaceIMolecularFormulaSet
- Overrides:
getMolecularFormula
in classAdductFormula
- Parameters:
position
- The position of the IMolecularFormula to be returned.- Returns:
- The IMolecularFormula at position
number
.
-
iterator
public Iterator<IMolecularFormula> iterator()
Returns an Iterator for looping over all IMolecularFormula in this adduct formula.- Specified by:
iterator
in interfaceIterable<IMolecularFormula>
- Overrides:
iterator
in classAdductFormula
- Returns:
- An Iterator with the IMolecularFormula in this adduct formula
-
molecularFormulas
public Iterable<IMolecularFormula> molecularFormulas()
Returns an Iterable for looping over all IMolecularFormula in this adduct formula.- Specified by:
molecularFormulas
in interfaceIMolecularFormulaSet
- Overrides:
molecularFormulas
in classAdductFormula
- Returns:
- An Iterable with the IMolecularFormula in this adduct formula
- See Also:
IMolecularFormulaSet.addMolecularFormula(IMolecularFormula)
-
removeAllMolecularFormulas
public void removeAllMolecularFormulas()
Removes all IMolecularFormula from this chemObject.- Specified by:
removeAllMolecularFormulas
in interfaceIMolecularFormulaSet
- Overrides:
removeAllMolecularFormulas
in classAdductFormula
-
removeMolecularFormula
public void removeMolecularFormula(IMolecularFormula formula)
Removes an IMolecularFormula from this chemObject.- Specified by:
removeMolecularFormula
in interfaceIMolecularFormulaSet
- Overrides:
removeMolecularFormula
in classAdductFormula
- 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 interfaceIMolecularFormulaSet
- Overrides:
removeMolecularFormula
in classAdductFormula
- Parameters:
position
- The position of the MolecularFormula to be removed from this chemObject
-
size
public int size()
Returns the number of MolecularFormulas in this AdductFormula.- Specified by:
size
in interfaceIMolecularFormulaSet
- Overrides:
size
in classAdductFormula
- Returns:
- The number of MolecularFormulas in this AdductFormula
-
getBuilder
public IChemObjectBuilder getBuilder()
Returns aIChemObjectBuilder
for the data classes that extend this class.- Specified by:
getBuilder
in interfaceICDKObject
- Overrides:
getBuilder
in classAdductFormula
- Returns:
- The
IChemObjectBuilder
matching thisICDKObject
-
-