Package org.openscience.cdk.debug
Class DebugReaction
java.lang.Object
org.openscience.cdk.ChemObject
org.openscience.cdk.Reaction
org.openscience.cdk.debug.DebugReaction
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<IAtomContainer>,ICDKObject,IChemObject,IReaction
Debugging data class.
- Author:
- egonw
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openscience.cdk.interfaces.IReaction
IReaction.Direction -
Field Summary
Fields inherited from class org.openscience.cdk.Reaction
agents, growArraySize, map, mappingCount, products, reactantsFields inherited from interface org.openscience.cdk.interfaces.IChemObject
ALIPHATIC, AROMATIC, CONJUGATED, HYDROGEN_BOND_ACCEPTOR, HYDROGEN_BOND_DONOR, IN_RING, MAPPED, MARKUSH, NOT_IN_RING, PLACED, REACTIVE_CENTER, SINGLE_OR_DOUBLE, TYPEABLE, VISITED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAgent(IAtomContainer agent) Adds an agent to this reaction.voidUse this to add yourself to this IChemObject as a listener.voidaddProduct(IAtomContainer product) Adds a product to this reaction.voidaddProduct(IAtomContainer product, Double coefficient) Adds a product to this reaction.voidaddProperties(Map<Object, Object> properties) Sets the properties of this object.voidaddReactant(IAtomContainer reactant) Adds a reactant to this reaction.voidaddReactant(IAtomContainer reactant, Double coefficient) Adds a reactant to this reaction with a stoichiometry coefficient.clone()Clones thisReactionand its content.intReturns the number of agents in this reaction.Returns a MoleculeSet containing the agents in this reaction.Returns aIChemObjectBuilderfor the data classes that extend this class.Returns the direction of the reaction.booleangetFlag(int flagType) Returns the value of a given flag.boolean[]getFlags()Returns the whole set of flags.getID()Returns the identifier (ID) of this object.intReturns the number of ChemObjectListeners registered with this object.getProductCoefficient(IAtomContainer product) Returns the stoichiometry coefficient of the given product.Double[]Returns an array of double with the stoichiometric coefficients of the products.intReturns the number of products in this reaction.Returns a MoleculeSet containing the products of this reaction.Returns a Map with the IChemObject's properties.<T> TgetProperty(Object description) Returns a property for the IChemObject.getReactantCoefficient(IAtomContainer reactant) Returns the stoichiometry coefficient of the given reactant.Double[]Returns an array of double with the stoichiometric coefficients of the reactants.intReturns the number of reactants in this reaction.Returns a MoleculeSet containing the reactants in this reaction.voidThis should be triggered by an method that changes the content of an object to that the registered listeners can react to it.voidThis should be triggered by an method that changes the content of an object to that the registered listeners can react to it.voidUse this to remove a ChemObjectListener from the ListenerList of this IChemObject.voidremoveProperty(Object description) Removes a property for a IChemObject.voidsetDirection(IReaction.Direction direction) Sets the direction of the reaction.voidsetFlag(int flagType, boolean flagValue) Sets the value of some flag.voidsetFlags(boolean[] flagsNew) Sets the whole set of flags.voidSets the identifier (ID) of this object.booleansetProductCoefficient(IAtomContainer product, Double coefficient) Sets the coefficient of a a product to a given value.booleansetProductCoefficients(Double[] coefficients) Sets the coefficient of the products.voidsetProducts(IAtomContainerSet products) Assigns a MoleculeSet to the products of this reaction.voidsetProperty(Object description, Object property) Sets a property for a IChemObject.booleansetReactantCoefficient(IAtomContainer reactant, Double coefficient) Sets the coefficient of a a reactant to a given value.booleansetReactantCoefficients(Double[] coefficients) Sets the coefficients of the reactants.voidsetReactants(IAtomContainerSet reactants) Assigns a MoleculeSet to the reactants in this reaction.Methods inherited from class org.openscience.cdk.Reaction
addMapping, getMapping, getMappingCount, mappings, removeMapping, toStringMethods inherited from class org.openscience.cdk.ChemObject
clear, compare, flags, getFlagValue, getNotification, getProperty, is, set, setNotification, setProperties, shallowCopyMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openscience.cdk.interfaces.IChemObject
clear, flags, getFlagValue, getNotification, getProperty, is, set, setNotification, setProperties, toStringMethods inherited from interface org.openscience.cdk.interfaces.IReaction
addMapping, getMapping, getMappingCount, iterator, mappings, removeMappingMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DebugReaction
public DebugReaction()
-
-
Method Details
-
addListener
Use this to add yourself to this IChemObject as a listener. In order to do so, you must implement the ChemObjectListener Interface.- Specified by:
addListenerin interfaceIChemObject- Overrides:
addListenerin classChemObject- Parameters:
col- the ChemObjectListener- See Also:
-
getListenerCount
public int getListenerCount()Returns the number of ChemObjectListeners registered with this object.- Specified by:
getListenerCountin interfaceIChemObject- Overrides:
getListenerCountin classChemObject- Returns:
- the number of registered listeners.
-
removeListener
Use this to remove a ChemObjectListener from the ListenerList of this IChemObject. It will then not be notified of change in this object anymore.- Specified by:
removeListenerin interfaceIChemObject- Overrides:
removeListenerin classChemObject- Parameters:
col- The ChemObjectListener to be removed- See Also:
-
notifyChanged
public void notifyChanged()This should be triggered by an method that changes the content of an object to that the registered listeners can react to it.- Specified by:
notifyChangedin interfaceIChemObject- Overrides:
notifyChangedin classChemObject
-
notifyChanged
This should be triggered by an method that changes the content of an object to that the registered listeners can react to it. This is a version of notifyChanged() which allows to propagate a change event while preserving the original origin.- Specified by:
notifyChangedin interfaceIChemObject- Overrides:
notifyChangedin classChemObject- Parameters:
evt- A ChemObjectChangeEvent pointing to the source of where the change happened
-
setProperty
Sets a property for a IChemObject.- Specified by:
setPropertyin interfaceIChemObject- Overrides:
setPropertyin classChemObject- Parameters:
description- An object description of the property (most likely a unique string)property- An object with the property itself- See Also:
-
removeProperty
Removes a property for a IChemObject.- Specified by:
removePropertyin interfaceIChemObject- Overrides:
removePropertyin classChemObject- Parameters:
description- The object description of the property (most likely a unique string)- See Also:
-
getProperty
Returns a property for the IChemObject.- Specified by:
getPropertyin interfaceIChemObject- Overrides:
getPropertyin classChemObject- Type Parameters:
T- generic return type- Parameters:
description- An object description of the property (most likely a unique string)- Returns:
- The object containing the property. Returns null if propert is not set.
- See Also:
-
getProperties
Returns a Map with the IChemObject's properties.- Specified by:
getPropertiesin interfaceIChemObject- Overrides:
getPropertiesin classChemObject- Returns:
- The object's properties as an Hashtable
- See Also:
-
getID
Returns the identifier (ID) of this object.- Specified by:
getIDin interfaceIChemObject- Overrides:
getIDin classChemObject- Returns:
- a String representing the ID value
- See Also:
-
setID
Sets the identifier (ID) of this object.- Specified by:
setIDin interfaceIChemObject- Overrides:
setIDin classChemObject- Parameters:
identifier- a String representing the ID value- See Also:
-
setFlag
public void setFlag(int flagType, boolean flagValue) Sets the value of some flag. The flag is a mask from a given CDKConstant (e.g.IChemObject.AROMATICorIChemObject.VISITED). The flags are intrinsic internal properties and should not be used to store custom values, please useIChemObject.setProperty(Object, Object).// set this chem object to be aromatic chemObject.setFlag(CDKConstants.ISAROMATIC, Boolean.TRUE); // ... // indicate we have visited this chem object chemObject.setFlag(CDKConstants.VISITED, Boolean.TRUE);- Specified by:
setFlagin interfaceIChemObject- Overrides:
setFlagin classChemObject- Parameters:
flagType- flag to set the value forflagValue- value to assign to flag- See Also:
-
getFlag
public boolean getFlag(int flagType) Returns the value of a given flag. The flag is a mask from a given CDKConstant (e.g.IChemObject.AROMATIC).if(chemObject.getFlag(CDKConstants.ISAROMATIC)){ // handle aromatic flag on this chem object }- Specified by:
getFlagin interfaceIChemObject- Overrides:
getFlagin classChemObject- Parameters:
flagType- flag to retrieve the value of- Returns:
- true if the flag
flag_typeis set - See Also:
-
addProperties
Sets the properties of this object.- Specified by:
addPropertiesin interfaceIChemObject- Overrides:
addPropertiesin classChemObject- Parameters:
properties- a Hashtable specifying the property values- See Also:
-
setFlags
public void setFlags(boolean[] flagsNew) Sets the whole set of flags.- Specified by:
setFlagsin interfaceIChemObject- Overrides:
setFlagsin classChemObject- Parameters:
flagsNew- the new flags.- See Also:
-
getFlags
public boolean[] getFlags()Returns the whole set of flags.- Specified by:
getFlagsin interfaceIChemObject- Overrides:
getFlagsin classChemObject- Returns:
- the flags.
- See Also:
-
clone
Clones thisReactionand its content.- Specified by:
clonein interfaceIChemObject- Overrides:
clonein classReaction- Returns:
- The cloned object
- Throws:
CloneNotSupportedException- if the IChemObject cannot be cloned
-
getBuilder
Returns aIChemObjectBuilderfor the data classes that extend this class.- Specified by:
getBuilderin interfaceICDKObject- Overrides:
getBuilderin classChemObject- Returns:
- The
IChemObjectBuildermatching thisICDKObject
-
getReactantCount
public int getReactantCount()Returns the number of reactants in this reaction.- Specified by:
getReactantCountin interfaceIReaction- Overrides:
getReactantCountin classReaction- Returns:
- The number of reactants in this reaction
-
getProductCount
public int getProductCount()Returns the number of products in this reaction.- Specified by:
getProductCountin interfaceIReaction- Overrides:
getProductCountin classReaction- Returns:
- The number of products in this reaction
-
getAgentCount
public int getAgentCount()Returns the number of agents in this reaction.- Specified by:
getAgentCountin interfaceIReaction- Overrides:
getAgentCountin classReaction- Returns:
- The number of agents in this reaction
-
getReactants
Returns a MoleculeSet containing the reactants in this reaction.- Specified by:
getReactantsin interfaceIReaction- Overrides:
getReactantsin classReaction- Returns:
- A MoleculeSet containing the reactants in this reaction
- See Also:
-
setReactants
Assigns a MoleculeSet to the reactants in this reaction.- Specified by:
setReactantsin interfaceIReaction- Overrides:
setReactantsin classReaction- Parameters:
reactants- The new set of reactants- See Also:
-
getProducts
Returns a MoleculeSet containing the products of this reaction.- Specified by:
getProductsin interfaceIReaction- Overrides:
getProductsin classReaction- Returns:
- A MoleculeSet containing the products in this reaction
- See Also:
-
setProducts
Assigns a MoleculeSet to the products of this reaction.- Specified by:
setProductsin interfaceIReaction- Overrides:
setProductsin classReaction- Parameters:
products- The new set of products- See Also:
-
getAgents
Returns a MoleculeSet containing the agents in this reaction. -
addReactant
Adds a reactant to this reaction.- Specified by:
addReactantin interfaceIReaction- Overrides:
addReactantin classReaction- Parameters:
reactant- Molecule added as reactant to this reaction- See Also:
-
addAgent
Adds an agent to this reaction. -
addReactant
Adds a reactant to this reaction with a stoichiometry coefficient.- Specified by:
addReactantin interfaceIReaction- Overrides:
addReactantin classReaction- Parameters:
reactant- Molecule added as reactant to this reactioncoefficient- Stoichiometry coefficient for this molecule- See Also:
-
addProduct
Adds a product to this reaction.- Specified by:
addProductin interfaceIReaction- Overrides:
addProductin classReaction- Parameters:
product- Molecule added as product to this reaction- See Also:
-
addProduct
Adds a product to this reaction.- Specified by:
addProductin interfaceIReaction- Overrides:
addProductin classReaction- Parameters:
product- Molecule added as product to this reactioncoefficient- Stoichiometry coefficient for this molecule- See Also:
-
getReactantCoefficient
Returns the stoichiometry coefficient of the given reactant.- Specified by:
getReactantCoefficientin interfaceIReaction- Overrides:
getReactantCoefficientin classReaction- Parameters:
reactant- Reactant for which the coefficient is returned.- Returns:
- -1, if the given molecule is not a product in this Reaction
- See Also:
-
getProductCoefficient
Returns the stoichiometry coefficient of the given product.- Specified by:
getProductCoefficientin interfaceIReaction- Overrides:
getProductCoefficientin classReaction- Parameters:
product- Product for which the coefficient is returned.- Returns:
- -1, if the given molecule is not a product in this Reaction
- See Also:
-
setReactantCoefficient
Sets the coefficient of a a reactant to a given value.- Specified by:
setReactantCoefficientin interfaceIReaction- Overrides:
setReactantCoefficientin classReaction- Parameters:
reactant- Reactant for which the coefficient is setcoefficient- The new coefficient for the given reactant- Returns:
- true if Molecule has been found and stoichiometry has been set.
- See Also:
-
setProductCoefficient
Sets the coefficient of a a product to a given value.- Specified by:
setProductCoefficientin interfaceIReaction- Overrides:
setProductCoefficientin classReaction- Parameters:
product- Product for which the coefficient is setcoefficient- The new coefficient for the given product- Returns:
- true if Molecule has been found and stoichiometry has been set.
- See Also:
-
getReactantCoefficients
Returns an array of double with the stoichiometric coefficients of the reactants.- Specified by:
getReactantCoefficientsin interfaceIReaction- Overrides:
getReactantCoefficientsin classReaction- Returns:
- An array of double's containing the coefficients of the reactants
- See Also:
-
getProductCoefficients
Returns an array of double with the stoichiometric coefficients of the products.- Specified by:
getProductCoefficientsin interfaceIReaction- Overrides:
getProductCoefficientsin classReaction- Returns:
- An array of double's containing the coefficients of the products
- See Also:
-
setReactantCoefficients
Sets the coefficients of the reactants.- Specified by:
setReactantCoefficientsin interfaceIReaction- Overrides:
setReactantCoefficientsin classReaction- Parameters:
coefficients- An array of double's containing the coefficients of the reactants- Returns:
- true if coefficients have been set.
- See Also:
-
setProductCoefficients
Sets the coefficient of the products.- Specified by:
setProductCoefficientsin interfaceIReaction- Overrides:
setProductCoefficientsin classReaction- Parameters:
coefficients- An array of double's containing the coefficients of the products- Returns:
- true if coefficients have been set.
- See Also:
-
setDirection
Sets the direction of the reaction.- Specified by:
setDirectionin interfaceIReaction- Overrides:
setDirectionin classReaction- Parameters:
direction- The new reaction direction- See Also:
-
getDirection
Returns the direction of the reaction.- Specified by:
getDirectionin interfaceIReaction- Overrides:
getDirectionin classReaction- Returns:
- The direction of this reaction (FORWARD, BACKWARD or BIDIRECTIONAL).
- See Also:
-