Package org.openscience.cdk.debug
Class DebugChemModel
- java.lang.Object
-
- org.openscience.cdk.ChemObject
-
- org.openscience.cdk.ChemModel
-
- org.openscience.cdk.debug.DebugChemModel
-
- All Implemented Interfaces:
Serializable,Cloneable,ICDKObject,IChemModel,IChemObject,IChemObjectListener
public class DebugChemModel extends ChemModel implements IChemModel
Debugging data class.- Author:
- egonw
- See Also:
- Serialized Form
- Source code:
- main
- Belongs to CDK module:
- datadebug
-
-
Field Summary
-
Fields inherited from class org.openscience.cdk.ChemModel
crystal, ringSet, setOfMolecules, setOfReactions
-
Fields inherited from interface org.openscience.cdk.interfaces.IChemObject
ALIPHATIC, AROMATIC, CONJUGATED, HYDROGEN_BOND_ACCEPTOR, HYDROGEN_BOND_DONOR, IN_RING, MAPPED, NOT_IN_RING, PLACED, REACTIVE_CENTER, SINGLE_OR_DOUBLE, TYPEABLE, VISITED
-
-
Constructor Summary
Constructors Constructor Description DebugChemModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(IChemObjectListener col)Use this to add yourself to this IChemObject as a listener.voidaddProperties(Map<Object,Object> properties)Sets the properties of this object.Objectclone()Clones thisChemModeland its content.IChemObjectBuildergetBuilder()Returns aIChemObjectBuilderfor the data classes that extend this class.ICrystalgetCrystal()Gets the Crystal contained in this ChemModel.booleangetFlag(int flagType)Returns the value of a given flag.boolean[]getFlags()Returns the whole set of flags.StringgetID()Returns the identifier (ID) of this object.intgetListenerCount()Returns the number of ChemObjectListeners registered with this object.IAtomContainerSetgetMoleculeSet()Returns the MoleculeSet of this ChemModel.Map<Object,Object>getProperties()Returns a Map with the IChemObject's properties.<T> TgetProperty(Object description)Returns a property for the IChemObject.IReactionSetgetReactionSet()Gets the ReactionSet contained in this ChemModel.IRingSetgetRingSet()Returns the RingSet of this ChemModel.booleanisEmpty()Returns true if this ChemModel is empty.voidnotifyChanged()This should be triggered by an method that changes the content of an object to that the registered listeners can react to it.voidnotifyChanged(IChemObjectChangeEvent evt)This should be triggered by an method that changes the content of an object to that the registered listeners can react to it.voidremoveListener(IChemObjectListener col)Use this to remove a ChemObjectListener from the ListenerList of this IChemObject.voidremoveProperty(Object description)Removes a property for a IChemObject.voidsetCrystal(ICrystal crystal)Sets the Crystal contained in this ChemModel.voidsetFlag(int flagType, boolean flagValue)Sets the value of some flag.voidsetFlags(boolean[] flagsNew)Sets the whole set of flags.voidsetID(String identifier)Sets the identifier (ID) of this object.voidsetMoleculeSet(IAtomContainerSet setOfMolecules)Sets the MoleculeSet of this ChemModel.voidsetProperty(Object description, Object property)Sets a property for a IChemObject.voidsetReactionSet(IReactionSet sor)Sets the ReactionSet contained in this ChemModel.voidsetRingSet(IRingSet ringSet)Sets the RingSet of this ChemModel.-
Methods inherited from class org.openscience.cdk.ChemModel
stateChanged, toString
-
Methods inherited from class org.openscience.cdk.ChemObject
clear, compare, flags, getFlagValue, getNotification, getProperty, is, set, setNotification, setProperties, shallowCopy
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openscience.cdk.interfaces.IChemObject
clear, flags, getFlagValue, getNotification, getProperty, is, set, setNotification, setProperties, toString
-
-
-
-
Method Detail
-
addListener
public void addListener(IChemObjectListener col)
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:
ChemObject.removeListener(org.openscience.cdk.interfaces.IChemObjectListener)
-
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
public void removeListener(IChemObjectListener col)
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:
ChemObject.addListener(org.openscience.cdk.interfaces.IChemObjectListener)
-
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
public void notifyChanged(IChemObjectChangeEvent evt)
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
public void setProperty(Object description, Object property)
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:
ChemObject.getProperty(java.lang.Object),ChemObject.removeProperty(java.lang.Object)
-
removeProperty
public void removeProperty(Object description)
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:
ChemObject.setProperty(java.lang.Object, java.lang.Object),ChemObject.getProperty(java.lang.Object)
-
getProperty
public <T> T getProperty(Object description)
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:
ChemObject.setProperty(java.lang.Object, java.lang.Object),ChemObject.removeProperty(java.lang.Object)
-
getProperties
public Map<Object,Object> 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:
ChemObject.addProperties(java.util.Map<java.lang.Object, java.lang.Object>)
-
getID
public String getID()
Returns the identifier (ID) of this object.- Specified by:
getIDin interfaceIChemObject- Overrides:
getIDin classChemObject- Returns:
- a String representing the ID value
- See Also:
ChemObject.setID(java.lang.String)
-
setID
public void setID(String identifier)
Sets the identifier (ID) of this object.- Specified by:
setIDin interfaceIChemObject- Overrides:
setIDin classChemObject- Parameters:
identifier- a String representing the ID value- See Also:
ChemObject.getID()
-
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:
IChemObject.getFlag(int)
-
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:
IChemObject.setFlag(int, boolean)
-
addProperties
public void addProperties(Map<Object,Object> properties)
Sets the properties of this object.- Specified by:
addPropertiesin interfaceIChemObject- Overrides:
addPropertiesin classChemObject- Parameters:
properties- a Hashtable specifying the property values- See Also:
ChemObject.getProperties()
-
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:
ChemObject.getFlags()
-
getFlags
public boolean[] getFlags()
Returns the whole set of flags.- Specified by:
getFlagsin interfaceIChemObject- Overrides:
getFlagsin classChemObject- Returns:
- the flags.
- See Also:
ChemObject.setFlags(boolean[])
-
clone
public Object clone() throws CloneNotSupportedException
Clones thisChemModeland its content.- Specified by:
clonein interfaceIChemObject- Overrides:
clonein classChemModel- Returns:
- The cloned object
- Throws:
CloneNotSupportedException- if the IChemObject cannot be cloned
-
getBuilder
public IChemObjectBuilder getBuilder()
Returns aIChemObjectBuilderfor the data classes that extend this class.- Specified by:
getBuilderin interfaceICDKObject- Overrides:
getBuilderin classChemObject- Returns:
- The
IChemObjectBuildermatching thisICDKObject
-
getMoleculeSet
public IAtomContainerSet getMoleculeSet()
Returns the MoleculeSet of this ChemModel.- Specified by:
getMoleculeSetin interfaceIChemModel- Overrides:
getMoleculeSetin classChemModel- Returns:
- The MoleculeSet of this ChemModel
- See Also:
ChemModel.setMoleculeSet(org.openscience.cdk.interfaces.IAtomContainerSet)
-
setMoleculeSet
public void setMoleculeSet(IAtomContainerSet setOfMolecules)
Sets the MoleculeSet of this ChemModel.- Specified by:
setMoleculeSetin interfaceIChemModel- Overrides:
setMoleculeSetin classChemModel- Parameters:
setOfMolecules- the content of this model- See Also:
ChemModel.getMoleculeSet()
-
getRingSet
public IRingSet getRingSet()
Returns the RingSet of this ChemModel.- Specified by:
getRingSetin interfaceIChemModel- Overrides:
getRingSetin classChemModel- Returns:
- the ringset of this model
- See Also:
ChemModel.setRingSet(org.openscience.cdk.interfaces.IRingSet)
-
setRingSet
public void setRingSet(IRingSet ringSet)
Sets the RingSet of this ChemModel.- Specified by:
setRingSetin interfaceIChemModel- Overrides:
setRingSetin classChemModel- Parameters:
ringSet- the content of this model- See Also:
ChemModel.getRingSet()
-
getCrystal
public ICrystal getCrystal()
Gets the Crystal contained in this ChemModel.- Specified by:
getCrystalin interfaceIChemModel- Overrides:
getCrystalin classChemModel- Returns:
- The crystal in this model
- See Also:
ChemModel.setCrystal(org.openscience.cdk.interfaces.ICrystal)
-
setCrystal
public void setCrystal(ICrystal crystal)
Sets the Crystal contained in this ChemModel.- Specified by:
setCrystalin interfaceIChemModel- Overrides:
setCrystalin classChemModel- Parameters:
crystal- the Crystal to store in this model- See Also:
ChemModel.getCrystal()
-
getReactionSet
public IReactionSet getReactionSet()
Gets the ReactionSet contained in this ChemModel.- Specified by:
getReactionSetin interfaceIChemModel- Overrides:
getReactionSetin classChemModel- Returns:
- The ReactionSet in this model
- See Also:
ChemModel.setReactionSet(org.openscience.cdk.interfaces.IReactionSet)
-
setReactionSet
public void setReactionSet(IReactionSet sor)
Sets the ReactionSet contained in this ChemModel.- Specified by:
setReactionSetin interfaceIChemModel- Overrides:
setReactionSetin classChemModel- Parameters:
sor- the ReactionSet to store in this model- See Also:
ChemModel.getReactionSet()
-
isEmpty
public boolean isEmpty()
Returns true if this ChemModel is empty.- Specified by:
isEmptyin interfaceIChemModel- Overrides:
isEmptyin classChemModel- Returns:
- a boolean indicating if this model has no content
-
-