Class DebugBond
java.lang.Object
org.openscience.cdk.ChemObject
org.openscience.cdk.ElectronContainer
org.openscience.cdk.Bond
org.openscience.cdk.debug.DebugBond
- All Implemented Interfaces:
Serializable, Cloneable, IBond, ICDKObject, IChemObject, IElectronContainer
-
Nested Class Summary
Nested classes/interfaces inherited from interface IBond
IBond.Display, IBond.Order, IBond.StereoModifier and TypeInterfaceDescriptionstatic enumBond display style, controlling how bonds appear in a 2D depiction.static enumA list of permissible bond orders.static enumDeprecated. -
Field Summary
Fields inherited from class Bond
atomCount, atoms, display, orderModifier and TypeFieldDescriptionprotected intNumber of atoms contained by this object.protected IAtom[]A list of atoms participating in this bond.protected IBond.Displayprotected IBond.OrderThe bond order of this bond.Fields inherited from class ElectronContainer
electronCountFields inherited from interface IChemObject
ALIPHATIC, AROMATIC, CONJUGATED, HIDDEN, HYDROGEN_BOND_ACCEPTOR, HYDROGEN_BOND_DONOR, IN_RING, MAPPED, MARKUSH, NOT_IN_RING, PLACED, REACTIVE_CENTER, SINGLE_OR_DOUBLE, TYPEABLE, VISITEDModifier and TypeFieldDescriptionstatic final intFlag that is set if a ChemObject is part of an aliphatic chain.static final intFlag is set if ChemObject is part of an aromatic system.static final intFlag is set if ChemObject is part of a conjugated system.static final intThis flag can be used when depicted structures to hide certain parts, for example the things are abbreviated (display shortcuts).static final intSets to true if the atom is a hydrogen bond acceptor.static final intSets to true if the atom is a hydrogen bond donor.static final intFlag that is set when the ChemObject is part of a ring.static final intFlag is set if a ChemObject is mapped to another ChemObject.static final intFlag to indicate a flattened molecule holds a Markush structure, you can work on it as is or it might make more sense to repack into something sensible like a RGroupQuery.static final intFlag that is set when the ChemObject is part of a ring.static final intFlag that is set if the ChemObject is placed when calculating 2D/3D layouts.static final intFlag is set if a ChemObject has reactive center.static final intFlag used for marking uncertainty of the bond order.static final intFlag is set if an atom could be typed.static final intFlag is set if ChemObject has been visited. -
Constructor Summary
ConstructorsConstructorDescriptionDebugBond(IAtom[] atoms, IBond.Order order) DebugBond(IAtom atom1, IAtom atom2, IBond.Order order) DebugBond(IAtom atom1, IAtom atom2, IBond.Order order, IBond.Stereo stereo) -
Method Summary
Modifier and TypeMethodDescriptionvoidUse this to add yourself to this IChemObject as a listener.voidaddProperties(Map<Object, Object> properties) Sets the properties of this object.atoms()Returns the Iterator to atoms making up this bond.clone()Clones this bond object, including clones of the atoms between which the bond is defined.booleanCompares a bond with this bond.booleanReturns true if the given atom participates in this bond.javax.vecmath.Point2dReturns the geometric 2D center of the bond.javax.vecmath.Point3dReturns the geometric 3D center of the bond.getAtom(int position) Returns an Atom from this bond.intReturns the number of Atoms in this Bond.getBegin()Access the begin (or first) atom of the bond.Returns aIChemObjectBuilderfor the data classes that extend this class.Returns the number of electrons in this electron container.getEnd()Access the end (or second) atom of the bond.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.getOrder()Returns the bond order of this bond.Returns the other atom in the bond, the atom is connected to the given atom.This method is only correct for two-centre bonds, for n-centre bonds the behaviour is undefined and the more correctIBond.getConnectedAtoms(IAtom)should be used.Returns a Map with the IChemObject's properties.<T> TgetProperty(Object description) Returns a property for the IChemObject.Returns the stereo descriptor for this bond.booleanisConnectedTo(IBond bond) Checks whether a bond is connected to another one.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.voidSets an Atom in this bond.voidSets the array of atoms making up this bond.voidsetElectronCount(Integer electronCount) Sets the number of electrons in this electron container.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.voidsetOrder(IBond.Order order) Sets the bond order of this bond.voidsetProperty(Object description, Object property) Sets a property for a IChemObject.voidsetStereo(IBond.Stereo stereo) Sets the stereo descriptor for this bond.Methods inherited from class Bond
equals, getConnectedAtom, getConnectedAtoms, getContainer, getDisplay, getIndex, hashCode, isAromatic, isInRing, setDisplay, setIsAromatic, setIsInRing, toStringModifier and TypeMethodDescriptionbooleangetConnectedAtom(IAtom atom) Returns the other atom in the bond, the atom is connected to the given atom.IAtom[]getConnectedAtoms(IAtom atom) Returns all the atoms in the bond connected to the given atom.Access the bond display style.intgetIndex()inthashCode()booleanAccess whether this bond has been marked as aromatic.booleanisInRing()Access whether this bond has been flagged as in a ring.voidsetDisplay(IBond.Display display) Set the bond display style.voidsetIsAromatic(boolean arom) Mark this bond as being aromatic.voidsetIsInRing(boolean ring) Mark this bond as being in a ring.toString()Returns a one line string representation of this Container.Methods inherited from class ChemObject
clear, flags, getFlagValue, getNotification, getProperty, is, set, setNotification, setProperties, shallowCopyModifier and TypeMethodDescriptionvoidclear(int flags) Clear the provided flags.intflags()Access the current value of the flags for this ChemObject.Access the internal value used to store the flags.booleanReturns the flag that indicates whether notification messages are sent around.<T> TgetProperty(Object description, Class<T> c) Access a property of the given description and cast the specified class.booleanis(int flags) Test if a flag(s) are set on this ChemObject.voidset(int flags) Set the provided flags.voidsetNotification(boolean bool) Set a flag to use or not use notification.voidsetProperties(Map<Object, Object> properties) Set the properties of this object to the provided map (shallow copy).Clones thisIChemObject, but preserves references toObjects.Methods inherited from interface IBond
getConnectedAtomModifier and TypeMethodDescriptiondefault IAtomgetConnectedAtom(IBond other) Get the connected atom between two bonds.
-
Constructor Details
-
DebugBond
public DebugBond() -
DebugBond
-
DebugBond
-
DebugBond
-
DebugBond
-
DebugBond
-
-
Method Details
-
getElectronCount
Returns the number of electrons in this electron container.- Specified by:
getElectronCountin interfaceIElectronContainer- Overrides:
getElectronCountin classElectronContainer- Returns:
- The number of electrons in this electron container.
- See Also:
-
setElectronCount
Sets the number of electrons in this electron container.- Specified by:
setElectronCountin interfaceIElectronContainer- Overrides:
setElectronCountin classElectronContainer- Parameters:
electronCount- The number of electrons in this electron container.- See Also:
-
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 bond object, including clones of the atoms between which the bond is defined.- Specified by:
clonein interfaceIBond- Specified by:
clonein interfaceIChemObject- Overrides:
clonein classBond- 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
-
atoms
-
setAtoms
-
getAtomCount
public int getAtomCount()Returns the number of Atoms in this Bond.- Specified by:
getAtomCountin interfaceIBond- Overrides:
getAtomCountin classBond- Returns:
- The number of Atoms in this Bond
-
getAtom
Returns an Atom from this bond. -
getBegin
-
getEnd
-
getOther
Returns the other atom in the bond, the atom is connected to the given atom.This method is only correct for two-centre bonds, for n-centre bonds the behaviour is undefined and the more correctIBond.getConnectedAtoms(IAtom)should be used.IAtom beg = bond.getBegin(); IAtom end = bond.getEnd(); // bond.getOther(beg) == end // bond.getOther(end) == beg -
contains
-
setAtom
-
getOrder
Returns the bond order of this bond. -
setOrder
Sets the bond order of this bond. -
getStereo
Returns the stereo descriptor for this bond. -
setStereo
Sets the stereo descriptor for this bond. -
get2DCenter
public javax.vecmath.Point2d get2DCenter()Returns the geometric 2D center of the bond.- Specified by:
get2DCenterin interfaceIBond- Overrides:
get2DCenterin classBond- Returns:
- The geometric 2D center of the bond
-
get3DCenter
public javax.vecmath.Point3d get3DCenter()Returns the geometric 3D center of the bond.- Specified by:
get3DCenterin interfaceIBond- Overrides:
get3DCenterin classBond- Returns:
- The geometric 3D center of the bond
-
compare
-
isConnectedTo
Checks whether a bond is connected to another one. This can only be true if the bonds have an Atom in common.- Specified by:
isConnectedToin interfaceIBond- Overrides:
isConnectedToin classBond- Parameters:
bond- The bond which is checked to be connect with this one- Returns:
- true if the bonds share an atom, otherwise false
-