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
Modifier and Type | Field and Description |
---|---|
protected IAtomContainerSet |
agents
These are the used solvent, catalysts etc that normally appear above
the reaction arrow
|
protected int |
growArraySize |
protected IMapping[] |
map |
protected int |
mappingCount |
protected IAtomContainerSet |
products |
protected IAtomContainerSet |
reactants |
Constructor and Description |
---|
Reaction()
Constructs an empty, forward reaction.
|
Modifier and Type | Method and Description |
---|---|
void |
addAgent(IAtomContainer 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(IAtomContainer product)
Adds a product to this reaction.
|
void |
addProduct(IAtomContainer product,
Double coefficient)
Adds a product to this reaction.
|
void |
addReactant(IAtomContainer reactant)
Adds a reactant to this reaction.
|
void |
addReactant(IAtomContainer reactant,
Double coefficient)
Adds a reactant to this reaction with a stoichiometry coefficient.
|
Object |
clone()
Clones this
Reaction and its content. |
IAtomContainerSet |
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(IAtomContainer 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.
|
IAtomContainerSet |
getProducts()
Returns a MoleculeSet containing the products of this reaction.
|
Double |
getReactantCoefficient(IAtomContainer 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.
|
IAtomContainerSet |
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(IAtomContainer 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(IAtomContainerSet setOfMolecules)
Assigns a MoleculeSet to the products of this reaction.
|
boolean |
setReactantCoefficient(IAtomContainer 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(IAtomContainerSet setOfMolecules)
Assigns a MoleculeSet to the reactants in this reaction.
|
String |
toString()
Returns a one line string representation of this Atom.
|
addListener, addProperties, compare, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
getBuilder
protected int growArraySize
protected IAtomContainerSet reactants
protected IAtomContainerSet products
protected IAtomContainerSet agents
protected IMapping[] map
protected int mappingCount
public int getReactantCount()
getReactantCount
in interface IReaction
public int getProductCount()
getProductCount
in interface IReaction
public IAtomContainerSet getReactants()
getReactants
in interface IReaction
IReaction.setReactants(org.openscience.cdk.interfaces.IAtomContainerSet)
public void setReactants(IAtomContainerSet setOfMolecules)
setReactants
in interface IReaction
setOfMolecules
- The new set of reactantsgetReactants()
public IAtomContainerSet getProducts()
getProducts
in interface IReaction
IReaction.setProducts(org.openscience.cdk.interfaces.IAtomContainerSet)
public void setProducts(IAtomContainerSet setOfMolecules)
setProducts
in interface IReaction
setOfMolecules
- The new set of productsgetProducts()
public IAtomContainerSet getAgents()
getAgents
in interface IReaction
addAgent(org.openscience.cdk.interfaces.IAtomContainer)
public Iterable<IMapping> mappings()
mappings
in interface IReaction
addMapping(org.openscience.cdk.interfaces.IMapping)
public void addReactant(IAtomContainer reactant)
addReactant
in interface IReaction
reactant
- Molecule added as reactant to this reactiongetReactants()
public void addAgent(IAtomContainer agent)
addAgent
in interface IReaction
agent
- Molecule added as agent to this reactiongetAgents()
public void addReactant(IAtomContainer reactant, Double coefficient)
addReactant
in interface IReaction
reactant
- Molecule added as reactant to this reactioncoefficient
- Stoichiometry coefficient for this moleculegetReactants()
public void addProduct(IAtomContainer product)
addProduct
in interface IReaction
product
- Molecule added as product to this reactiongetProducts()
public void addProduct(IAtomContainer product, Double coefficient)
addProduct
in interface IReaction
product
- Molecule added as product to this reactioncoefficient
- Stoichiometry coefficient for this moleculegetProducts()
public Double getReactantCoefficient(IAtomContainer reactant)
getReactantCoefficient
in interface IReaction
reactant
- Reactant for which the coefficient is returned.setReactantCoefficient(org.openscience.cdk.interfaces.IAtomContainer, java.lang.Double)
public Double getProductCoefficient(IAtomContainer product)
getProductCoefficient
in interface IReaction
product
- Product for which the coefficient is returned.setProductCoefficient(org.openscience.cdk.interfaces.IAtomContainer, java.lang.Double)
public boolean setReactantCoefficient(IAtomContainer 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.IAtomContainer)
public boolean setProductCoefficient(IAtomContainer 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.IAtomContainer)
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 clonedCopyright © 2021. All rights reserved.