Package org.openscience.cdk.debug
Class DebugAtomContainerSet
java.lang.Object
org.openscience.cdk.ChemObject
org.openscience.cdk.AtomContainerSet
org.openscience.cdk.debug.DebugAtomContainerSet
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<IAtomContainer>,IAtomContainerSet,ICDKObject,IChemObject,IChemObjectListener
Debugging data class.
- Author:
- egonw
- See Also:
-
Field Summary
Fields inherited from class org.openscience.cdk.AtomContainerSet
atomContainerCount, atomContainers, growArraySize, multipliersFields 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 TypeMethodDescriptionvoidadd(IAtomContainerSet atomContainerSet) Adds all atomContainers in the AtomContainerSet to this container.voidaddAtomContainer(IAtomContainer atomContainer) Adds an atomContainer to this container.voidaddAtomContainer(IAtomContainer atomContainer, double multiplier) Adds an atomContainer to this container with the given multiplier.voidUse this to add yourself to this IChemObject as a listener.voidaddProperties(Map<Object, Object> properties) Sets the properties of this object.Get an iterator for this AtomContainerSet.clone()Clones this AtomContainerSet and its content.getAtomContainer(int number) Returns the AtomContainer at positionnumberin the container.intReturns the number of AtomContainers in this Container.Returns aIChemObjectBuilderfor the data classes that extend this class.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.getMultiplier(int number) Returns the multiplier for the AtomContainer at positionnumberin the container.getMultiplier(IAtomContainer container) Returns the multiplier of the given AtomContainer.Double[]Returns an array of double with the stoichiometric coefficients of the products.Returns a Map with the IChemObject's properties.<T> TgetProperty(Object description) Returns a property for the IChemObject.booleanisEmpty()Returns true if this IAtomContainerSet is empty.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.voidRemoves all AtomContainer from this container.voidremoveAtomContainer(int pos) Removes an AtomContainer from this container.voidremoveAtomContainer(IAtomContainer atomContainer) Removes an AtomContainer from this container.voidUse this to remove a ChemObjectListener from the ListenerList of this IChemObject.voidremoveProperty(Object description) Removes a property for a IChemObject.voidreplaceAtomContainer(int position, IAtomContainer container) Replace the AtomContainer at a specific position (array has to be large enough).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.voidsetMultiplier(int position, Double multiplier) Sets the coefficient of a AtomContainer to a given value.booleansetMultiplier(IAtomContainer container, Double multiplier) Sets the coefficient of a AtomContainer to a given value.booleansetMultipliers(Double[] newMultipliers) Sets the multipliers of the AtomContainers.voidsetProperty(Object description, Object property) Sets a property for a IChemObject.Methods inherited from class org.openscience.cdk.AtomContainerSet
growAtomContainerArray, sortAtomContainers, stateChanged, 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.IAtomContainerSet
iterator, sortAtomContainersMethods inherited from interface org.openscience.cdk.interfaces.IChemObject
clear, flags, getFlagValue, getNotification, getProperty, is, set, setNotification, setProperties, toStringMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DebugAtomContainerSet
public DebugAtomContainerSet()
-
-
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 this AtomContainerSet and its content.- Specified by:
clonein interfaceIChemObject- Overrides:
clonein classAtomContainerSet- 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
-
addAtomContainer
Adds an atomContainer to this container.- Specified by:
addAtomContainerin interfaceIAtomContainerSet- Overrides:
addAtomContainerin classAtomContainerSet- Parameters:
atomContainer- The atomContainer to be added to this container
-
removeAtomContainer
Removes an AtomContainer from this container.- Specified by:
removeAtomContainerin interfaceIAtomContainerSet- Overrides:
removeAtomContainerin classAtomContainerSet- Parameters:
atomContainer- The atomContainer to be removed from this container
-
removeAllAtomContainers
public void removeAllAtomContainers()Removes all AtomContainer from this container.- Specified by:
removeAllAtomContainersin interfaceIAtomContainerSet- Overrides:
removeAllAtomContainersin classAtomContainerSet
-
removeAtomContainer
public void removeAtomContainer(int pos) Removes an AtomContainer from this container.- Specified by:
removeAtomContainerin interfaceIAtomContainerSet- Overrides:
removeAtomContainerin classAtomContainerSet- Parameters:
pos- The position of the AtomContainer to be removed from this container
-
replaceAtomContainer
Replace the AtomContainer at a specific position (array has to be large enough).- Specified by:
replaceAtomContainerin interfaceIAtomContainerSet- Overrides:
replaceAtomContainerin classAtomContainerSet- Parameters:
position- position in array for AtomContainercontainer- the replacement AtomContainer
-
setMultiplier
Sets the coefficient of a AtomContainer to a given value.- Specified by:
setMultiplierin interfaceIAtomContainerSet- Overrides:
setMultiplierin classAtomContainerSet- Parameters:
container- The AtomContainer for which the multiplier is setmultiplier- The new multiplier for the AtomContatiner- Returns:
- true if multiplier has been set
- See Also:
-
setMultiplier
Sets the coefficient of a AtomContainer to a given value.- Specified by:
setMultiplierin interfaceIAtomContainerSet- Overrides:
setMultiplierin classAtomContainerSet- Parameters:
position- The position of the AtomContainer for which the multiplier is set in [0,..]multiplier- The new multiplier for the AtomContatiner atposition- See Also:
-
getMultipliers
Returns an array of double with the stoichiometric coefficients of the products.- Specified by:
getMultipliersin interfaceIAtomContainerSet- Overrides:
getMultipliersin classAtomContainerSet- Returns:
- The multipliers for the AtomContainer's in this set
- See Also:
-
setMultipliers
Sets the multipliers of the AtomContainers.- Specified by:
setMultipliersin interfaceIAtomContainerSet- Overrides:
setMultipliersin classAtomContainerSet- Parameters:
newMultipliers- The new multipliers for the AtomContainers in this set- Returns:
- true if multipliers have been set.
- See Also:
-
addAtomContainer
Adds an atomContainer to this container with the given multiplier.- Specified by:
addAtomContainerin interfaceIAtomContainerSet- Overrides:
addAtomContainerin classAtomContainerSet- Parameters:
atomContainer- The atomContainer to be added to this containermultiplier- The multiplier of this atomContainer
-
add
Adds all atomContainers in the AtomContainerSet to this container.- Specified by:
addin interfaceIAtomContainerSet- Overrides:
addin classAtomContainerSet- Parameters:
atomContainerSet- The AtomContainerSet
-
atomContainers
Get an iterator for this AtomContainerSet.- Specified by:
atomContainersin interfaceIAtomContainerSet- Overrides:
atomContainersin classAtomContainerSet- Returns:
- A new Iterator for this AtomContainerSet.
-
getAtomContainer
Returns the AtomContainer at positionnumberin the container.- Specified by:
getAtomContainerin interfaceIAtomContainerSet- Overrides:
getAtomContainerin classAtomContainerSet- Parameters:
number- The position of the AtomContainer to be returned.- Returns:
- The AtomContainer at position
number.
-
getMultiplier
Returns the multiplier for the AtomContainer at positionnumberin the container.- Specified by:
getMultiplierin interfaceIAtomContainerSet- Overrides:
getMultiplierin classAtomContainerSet- Parameters:
number- The position of the multiplier of the AtomContainer to be returned.- Returns:
- The multiplier for the AtomContainer at position
number. - See Also:
-
getMultiplier
Returns the multiplier of the given AtomContainer.- Specified by:
getMultiplierin interfaceIAtomContainerSet- Overrides:
getMultiplierin classAtomContainerSet- Parameters:
container- The AtomContainer for which the multiplier is given- Returns:
- -1, if the given molecule is not a container in this set
- See Also:
-
getAtomContainerCount
public int getAtomContainerCount()Returns the number of AtomContainers in this Container.- Specified by:
getAtomContainerCountin interfaceIAtomContainerSet- Overrides:
getAtomContainerCountin classAtomContainerSet- Returns:
- The number of AtomContainers in this Container
-
isEmpty
public boolean isEmpty()Returns true if this IAtomContainerSet is empty.- Specified by:
isEmptyin interfaceIAtomContainerSet- Overrides:
isEmptyin classAtomContainerSet- Returns:
- a boolean indicating if this ring set no atom containers
-