public class Reaction extends ChemObject implements Serializable, IReaction, Cloneable
The class mostly represents abstract reactions, such as 2D diagrams, and is not intended to represent reaction trajectories. Such can better be represented with a ChemSequence.
IReaction.Direction
Constructor and Description |
---|
Reaction()
Constructs an empty, forward reaction.
|
Modifier and Type | Method and Description |
---|---|
void |
addAgent(IMolecule agent)
Adds an agent to this reaction.
|
void |
addMapping(IMapping mapping)
Adds a mapping between the reactant and product side to this
Reaction.
|
void |
addProduct(IMolecule product)
Adds a product to this reaction.
|
void |
addProduct(IMolecule product,
Double coefficient)
Adds a product to this reaction.
|
void |
addReactant(IMolecule reactant)
Adds a reactant to this reaction.
|
void |
addReactant(IMolecule reactant,
Double coefficient)
Adds a reactant to this reaction with a stoichiometry coefficient.
|
Object |
clone()
Clones this
Reaction and its content. |
IMoleculeSet |
getAgents()
Returns a MoleculeSet containing the agents in this reaction.
|
IReaction.Direction |
getDirection()
Returns the direction of the reaction.
|
IMapping |
getMapping(int pos)
Retrieves a mapping between the reactant and product side to this
Reaction.
|
int |
getMappingCount()
Get the number of mappings between the reactant and product side to this
Reaction.
|
Double |
getProductCoefficient(IMolecule product)
Returns the stoichiometry coefficient of the given product.
|
Double[] |
getProductCoefficients()
Returns an array of double with the stoichiometric coefficients
of the products.
|
int |
getProductCount()
Returns the number of products in this reaction.
|
IMoleculeSet |
getProducts()
Returns a MoleculeSet containing the products of this reaction.
|
Double |
getReactantCoefficient(IMolecule reactant)
Returns the stoichiometry coefficient of the given reactant.
|
Double[] |
getReactantCoefficients()
Returns an array of double with the stoichiometric coefficients
of the reactants.
|
int |
getReactantCount()
Returns the number of reactants in this reaction.
|
IMoleculeSet |
getReactants()
Returns a MoleculeSet containing the reactants in this reaction.
|
Iterable<IMapping> |
mappings()
Returns the mappings between the reactant and the product side.
|
void |
removeMapping(int pos)
Removes a mapping between the reactant and product side to this
Reaction.
|
void |
setDirection(IReaction.Direction direction)
Sets the direction of the reaction.
|
boolean |
setProductCoefficient(IMolecule product,
Double coefficient)
Sets the coefficient of a a product to a given value.
|
boolean |
setProductCoefficients(Double[] coefficients)
Sets the coefficient of the products.
|
void |
setProducts(IMoleculeSet setOfMolecules)
Assigns a MoleculeSet to the products of this reaction.
|
boolean |
setReactantCoefficient(IMolecule reactant,
Double coefficient)
Sets the coefficient of a a reactant to a given value.
|
boolean |
setReactantCoefficients(Double[] coefficients)
Sets the coefficients of the reactants.
|
void |
setReactants(IMoleculeSet setOfMolecules)
Assigns a MoleculeSet to the reactants in this reaction.
|
String |
toString()
Returns a one line string representation of this Atom.
|
addListener, compare, getBuilder, getFlag, getFlags, getID, getListenerCount, getNotification, getProperties, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addListener, getFlag, getFlags, getID, getListenerCount, getNotification, getProperties, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
getBuilder
public int getReactantCount()
getReactantCount
in interface IReaction
public int getProductCount()
getProductCount
in interface IReaction
public IMoleculeSet getReactants()
getReactants
in interface IReaction
setReactants(org.openscience.cdk.interfaces.IMoleculeSet)
public void setReactants(IMoleculeSet setOfMolecules)
setReactants
in interface IReaction
setOfMolecules
- The new set of reactantsgetReactants()
public IMoleculeSet getProducts()
getProducts
in interface IReaction
setProducts(org.openscience.cdk.interfaces.IMoleculeSet)
public void setProducts(IMoleculeSet setOfMolecules)
setProducts
in interface IReaction
setOfMolecules
- The new set of productsgetProducts()
public IMoleculeSet getAgents()
getAgents
in interface IReaction
addAgent(org.openscience.cdk.interfaces.IMolecule)
public Iterable<IMapping> mappings()
mappings
in interface IReaction
addMapping(org.openscience.cdk.interfaces.IMapping)
public void addReactant(IMolecule reactant)
addReactant
in interface IReaction
reactant
- Molecule added as reactant to this reactiongetReactants()
public void addAgent(IMolecule agent)
addAgent
in interface IReaction
agent
- Molecule added as agent to this reactiongetAgents()
public void addReactant(IMolecule reactant, Double coefficient)
addReactant
in interface IReaction
reactant
- Molecule added as reactant to this reactioncoefficient
- Stoichiometry coefficient for this moleculegetReactants()
public void addProduct(IMolecule product)
addProduct
in interface IReaction
product
- Molecule added as product to this reactiongetProducts()
public void addProduct(IMolecule product, Double coefficient)
addProduct
in interface IReaction
product
- Molecule added as product to this reactioncoefficient
- Stoichiometry coefficient for this moleculegetProducts()
public Double getReactantCoefficient(IMolecule reactant)
getReactantCoefficient
in interface IReaction
reactant
- Reactant for which the coefficient is returned.setReactantCoefficient(org.openscience.cdk.interfaces.IMolecule, java.lang.Double)
public Double getProductCoefficient(IMolecule product)
getProductCoefficient
in interface IReaction
product
- Product for which the coefficient is returned.setProductCoefficient(org.openscience.cdk.interfaces.IMolecule, java.lang.Double)
public boolean setReactantCoefficient(IMolecule reactant, Double coefficient)
setReactantCoefficient
in interface IReaction
reactant
- Reactant for which the coefficient is setcoefficient
- The new coefficient for the given reactantgetReactantCoefficient(org.openscience.cdk.interfaces.IMolecule)
public boolean setProductCoefficient(IMolecule product, Double coefficient)
setProductCoefficient
in interface IReaction
product
- Product for which the coefficient is setcoefficient
- The new coefficient for the given productgetProductCoefficient(org.openscience.cdk.interfaces.IMolecule)
public Double[] getReactantCoefficients()
getReactantCoefficients
in interface IReaction
setReactantCoefficients(java.lang.Double[])
public Double[] getProductCoefficients()
getProductCoefficients
in interface IReaction
setProductCoefficients(java.lang.Double[])
public boolean setReactantCoefficients(Double[] coefficients)
setReactantCoefficients
in interface IReaction
coefficients
- An array of double's containing the coefficients of the reactantsgetReactantCoefficients()
public boolean setProductCoefficients(Double[] coefficients)
setProductCoefficients
in interface IReaction
coefficients
- An array of double's containing the coefficients of the productsgetProductCoefficients()
public void setDirection(IReaction.Direction direction)
setDirection
in interface IReaction
direction
- The new reaction directiongetDirection()
public IReaction.Direction getDirection()
getDirection
in interface IReaction
IReaction.Direction
,
setDirection(org.openscience.cdk.interfaces.IReaction.Direction)
public void addMapping(IMapping mapping)
addMapping
in interface IReaction
mapping
- Mapping to add.mappings()
public void removeMapping(int pos)
removeMapping
in interface IReaction
pos
- Position of the Mapping to remove.mappings()
public IMapping getMapping(int pos)
getMapping
in interface IReaction
pos
- Position of Mapping to get.public int getMappingCount()
getMappingCount
in interface IReaction
public String toString()
toString
in interface IChemObject
toString
in class Object
public Object clone() throws CloneNotSupportedException
Reaction
and its content.clone
in interface IChemObject
clone
in class ChemObject
CloneNotSupportedException
- if the IChemObject cannot be cloned