Package org.openscience.cdk.debug
Class DebugAtom
java.lang.Object
org.openscience.cdk.ChemObject
org.openscience.cdk.Element
org.openscience.cdk.Isotope
org.openscience.cdk.AtomType
org.openscience.cdk.Atom
org.openscience.cdk.debug.DebugAtom
- All Implemented Interfaces:
Serializable,Cloneable,IAtom,IAtomType,ICDKObject,IChemObject,IElement,IIsotope
Debugging data class.
- Author:
- egonw
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openscience.cdk.interfaces.IAtomType
IAtomType.Hybridization -
Field Summary
Fields inherited from class org.openscience.cdk.Atom
charge, fractionalPoint3d, hydrogenCount, point2d, point3d, stereoParityFields inherited from class org.openscience.cdk.AtomType
electronValency, formalCharge, formalNeighbourCount, hybridizationFields inherited from class org.openscience.cdk.Isotope
exactMass, naturalAbundanceFields inherited from class org.openscience.cdk.Element
atomicNumberFields 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, VISITEDFields inherited from interface org.openscience.cdk.interfaces.IElement
Ac, Ag, Al, Am, Ar, As, At, Au, B, Ba, Be, Bh, Bi, Bk, Br, C, Ca, Cd, Ce, Cf, Cl, Cm, Cn, Co, Cr, Cs, Cu, Db, Ds, Dy, Er, Es, Eu, F, Fe, Fl, Fm, Fr, Ga, Gd, Ge, H, He, Hf, Hg, Ho, Hs, I, In, Ir, K, Kr, La, Li, Lr, Lu, Lv, Mc, Md, Mg, Mn, Mo, Mt, N, Na, Nb, Nd, Ne, Nh, Ni, No, Np, O, Og, Os, P, Pa, Pb, Pd, Pm, Po, Pr, Pt, Pu, Ra, Rb, Re, Rf, Rg, Rh, Rn, Ru, S, Sb, Sc, Se, Sg, Si, Sm, Sn, Sr, Ta, Tb, Tc, Te, Th, Ti, Tl, Tm, Ts, U, V, W, Wildcard, Xe, Y, Yb, Zn, Zr -
Constructor Summary
Constructors -
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.bonds()Returns the bonds connected to this atom.clone()Clones this atom object and its content.Returns the atomic number of this element.Gets the id attribute of the AtomType object.Gets the bondOrderSum attribute of the AtomType object.Returns aIChemObjectBuilderfor the data classes that extend this class.Returns the partial charge of this atom.Access theIAtomContainerof which this atom is a member of.Returns the covalent radius for this AtomType.Gets the ExactMass attribute of the Isotope object.booleangetFlag(int flagType) Returns the value of a given flag.boolean[]getFlags()Returns the whole set of flags.Returns the formal charge of this atom.Returns the formal neighbour count of this atom.javax.vecmath.Point3dReturns a point specifying the location of this atom in a Crystal unit cell.Returns the hybridization of this atom.getID()Returns the identifier (ID) of this object.Returns the hydrogen count of this atom.intgetIndex()Acces the index of an atom in the context of anIAtomContainer.intReturns the number of ChemObjectListeners registered with this object.Returns the atomic mass of this element.Gets the MaxBondOrder attribute of the AtomType object.Gets the NaturalAbundance attribute of the Isotope object.javax.vecmath.Point2dReturns a point specifying the location of this atom in a 2D space.javax.vecmath.Point3dReturns a point specifying the location of this atom in a 3D space.Returns a Map with the IChemObject's properties.<T> TgetProperty(Object description) Returns a property for the IChemObject.Returns the stereo parity of this atom.Returns the element symbol of this element.Gets the the exact electron valency of the AtomType object.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.voidsetAtomicNumber(Integer atomicNumber) Sets the atomic number of this element.voidsetAtomTypeName(String identifier) Sets the if attribute of the AtomType object.voidsetBondOrderSum(Double bondOrderSum) Sets the the exact bond order sum attribute of the AtomType object.voidSets the partial charge of this atom.voidsetCovalentRadius(Double radius) Sets the covalent radius for this AtomType.voidsetExactMass(Double exactMass) Sets the ExactMass attribute of the Isotope object.voidsetFlag(int flagType, boolean flagValue) Sets the value of some flag.voidsetFlags(boolean[] flagsNew) Sets the whole set of flags.voidsetFormalCharge(Integer charge) Sets the formal charge of this atom.voidsetFormalNeighbourCount(Integer count) Sets the formal neighbour count of this atom.voidsetFractionalPoint3d(javax.vecmath.Point3d point3d) Sets a point specifying the location of this atom in a Crystal unit cell.voidsetHybridization(IAtomType.Hybridization hybridization) Sets the hybridization of this atom.voidSets the identifier (ID) of this object.voidsetImplicitHydrogenCount(Integer hydrogenCount) Sets the number of implicit hydrogen count of this atom.voidsetMassNumber(Integer massNumber) Sets the atomic mass of this element.voidsetMaxBondOrder(IBond.Order maxBondOrder) Sets the MaxBondOrder attribute of the AtomType object.voidsetNaturalAbundance(Double naturalAbundance) Sets the NaturalAbundance attribute of the Isotope object.voidsetPoint2d(javax.vecmath.Point2d point2d) Sets a point specifying the location of this atom in a 2D space.voidsetPoint3d(javax.vecmath.Point3d point3d) Sets a point specifying the location of this atom in 3D space.voidsetProperty(Object description, Object property) Sets a property for a IChemObject.voidsetStereoParity(Integer stereoParity) Sets the stereo parity for this atom.voidSets the element symbol of this element.voidsetValency(Integer valency) Sets the the exact electron valency of the AtomType object.Methods inherited from class org.openscience.cdk.Atom
compare, equals, getBond, getBondCount, getMapIdx, hashCode, setMapIdx, toStringMethods inherited from class org.openscience.cdk.ChemObject
clear, flags, getFlagValue, getNotification, getProperty, is, set, setNotification, setProperties, shallowCopyMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openscience.cdk.interfaces.IAtom
getBond, getBondCount, getMapIdx, getTotalHydrogenCount, isAromatic, isInRing, neighbors, setIsAromatic, setIsInRing, setMapIdxMethods inherited from interface org.openscience.cdk.interfaces.IChemObject
clear, flags, getFlagValue, getNotification, getProperty, is, set, setNotification, setProperties, toString
-
Constructor Details
-
DebugAtom
public DebugAtom() -
DebugAtom
-
DebugAtom
-
DebugAtom
-
DebugAtom
-
-
Method Details
-
getContainer
Access theIAtomContainerof which this atom is a member of. Because atoms can be in multiple molecules this method will only work if the atom has been accessed in the context of anIAtomContainer, for example:IAtomContainer mol = new AtomContainer(); IAtom atom = new Atom(6); atom.getContainer(); // null mol.add(atom); atom.getContainer(); // still null mol.getAtom(0).getContainer(); // not-null, returns 'mol'- Specified by:
getContainerin interfaceIAtom- Overrides:
getContainerin classAtom- Returns:
- the atom container or null if not accessed in the context of a container
-
getIndex
public int getIndex()Acces the index of an atom in the context of anIAtomContainer. If the index is not known, < 0 is returned. -
bonds
Returns the bonds connected to this atom. If the bonds are not known an exception is thrown. This method will only throw an exception ifIAtom.getIndex()returns < 0 orIAtom.getContainer()returns null.IAtom atom = ...; if (atom.getIndex() >= 0) { for (IBond bond : atom.bonds()) { } } if (atom.getContainer() != null) { for (IBond bond : atom.bonds()) { } } IAtomContainer mol = ...; // guaranteed not throw an exception for (IBond bond : mol.getAtom(i).bonds()) { } -
setCharge
Sets the partial charge of this atom. -
getCharge
Returns the partial charge of this atom. If the charge has not been set the return value is Double.NaN -
setImplicitHydrogenCount
Sets the number of implicit hydrogen count of this atom.- Specified by:
setImplicitHydrogenCountin interfaceIAtom- Overrides:
setImplicitHydrogenCountin classAtom- Parameters:
hydrogenCount- The number of hydrogen atoms bonded to this atom.- See Also:
-
getImplicitHydrogenCount
Returns the hydrogen count of this atom.- Specified by:
getImplicitHydrogenCountin interfaceIAtom- Overrides:
getImplicitHydrogenCountin classAtom- Returns:
- The hydrogen count of this atom.
- See Also:
-
setPoint2d
public void setPoint2d(javax.vecmath.Point2d point2d) Sets a point specifying the location of this atom in a 2D space.- Specified by:
setPoint2din interfaceIAtom- Overrides:
setPoint2din classAtom- Parameters:
point2d- A point in a 2D plane- See Also:
-
setPoint3d
public void setPoint3d(javax.vecmath.Point3d point3d) Sets a point specifying the location of this atom in 3D space.- Specified by:
setPoint3din interfaceIAtom- Overrides:
setPoint3din classAtom- Parameters:
point3d- A point in a 3-dimensional space- See Also:
-
setFractionalPoint3d
public void setFractionalPoint3d(javax.vecmath.Point3d point3d) Sets a point specifying the location of this atom in a Crystal unit cell.- Specified by:
setFractionalPoint3din interfaceIAtom- Overrides:
setFractionalPoint3din classAtom- Parameters:
point3d- A point in a 3d fractional unit cell space- See Also:
-
setStereoParity
Sets the stereo parity for this atom.- Specified by:
setStereoParityin interfaceIAtom- Overrides:
setStereoParityin classAtom- Parameters:
stereoParity- The stereo parity for this atom- See Also:
-
getPoint2d
public javax.vecmath.Point2d getPoint2d()Returns a point specifying the location of this atom in a 2D space.- Specified by:
getPoint2din interfaceIAtom- Overrides:
getPoint2din classAtom- Returns:
- A point in a 2D plane. Null if unset.
- See Also:
-
getPoint3d
public javax.vecmath.Point3d getPoint3d()Returns a point specifying the location of this atom in a 3D space.- Specified by:
getPoint3din interfaceIAtom- Overrides:
getPoint3din classAtom- Returns:
- A point in 3-dimensional space. Null if unset.
- See Also:
-
getFractionalPoint3d
public javax.vecmath.Point3d getFractionalPoint3d()Returns a point specifying the location of this atom in a Crystal unit cell.- Specified by:
getFractionalPoint3din interfaceIAtom- Overrides:
getFractionalPoint3din classAtom- Returns:
- A point in 3d fractional unit cell space. Null if unset.
- See Also:
-
getStereoParity
Returns the stereo parity of this atom. It uses the predefined values found in CDKConstants.- Specified by:
getStereoParityin interfaceIAtom- Overrides:
getStereoParityin classAtom- Returns:
- The stereo parity for this atom
- See Also:
-
setAtomTypeName
Sets the if attribute of the AtomType object.- Specified by:
setAtomTypeNamein interfaceIAtomType- Overrides:
setAtomTypeNamein classAtomType- Parameters:
identifier- The new AtomTypeID value. Null if unset.- See Also:
-
setMaxBondOrder
Sets the MaxBondOrder attribute of the AtomType object.- Specified by:
setMaxBondOrderin interfaceIAtomType- Overrides:
setMaxBondOrderin classAtomType- Parameters:
maxBondOrder- The new MaxBondOrder value- See Also:
-
setBondOrderSum
Sets the the exact bond order sum attribute of the AtomType object.- Specified by:
setBondOrderSumin interfaceIAtomType- Overrides:
setBondOrderSumin classAtomType- Parameters:
bondOrderSum- The new bondOrderSum value- See Also:
-
getAtomTypeName
Gets the id attribute of the AtomType object.- Specified by:
getAtomTypeNamein interfaceIAtomType- Overrides:
getAtomTypeNamein classAtomType- Returns:
- The id value
- See Also:
-
getMaxBondOrder
Gets the MaxBondOrder attribute of the AtomType object.- Specified by:
getMaxBondOrderin interfaceIAtomType- Overrides:
getMaxBondOrderin classAtomType- Returns:
- The MaxBondOrder value
- See Also:
-
getBondOrderSum
Gets the bondOrderSum attribute of the AtomType object.- Specified by:
getBondOrderSumin interfaceIAtomType- Overrides:
getBondOrderSumin classAtomType- Returns:
- The bondOrderSum value
- See Also:
-
setFormalCharge
Sets the formal charge of this atom.- Specified by:
setFormalChargein interfaceIAtomType- Overrides:
setFormalChargein classAtomType- Parameters:
charge- The formal charge- See Also:
-
getFormalCharge
Returns the formal charge of this atom.- Specified by:
getFormalChargein interfaceIAtomType- Overrides:
getFormalChargein classAtomType- Returns:
- the formal charge of this atom
- See Also:
-
setFormalNeighbourCount
Sets the formal neighbour count of this atom.- Specified by:
setFormalNeighbourCountin interfaceIAtomType- Overrides:
setFormalNeighbourCountin classAtomType- Parameters:
count- The neighbour count- See Also:
-
getFormalNeighbourCount
Returns the formal neighbour count of this atom.- Specified by:
getFormalNeighbourCountin interfaceIAtomType- Overrides:
getFormalNeighbourCountin classAtomType- Returns:
- the formal neighbour count of this atom
- See Also:
-
setHybridization
Sets the hybridization of this atom.- Specified by:
setHybridizationin interfaceIAtomType- Overrides:
setHybridizationin classAtomType- Parameters:
hybridization- The hybridization- See Also:
-
getHybridization
Returns the hybridization of this atom.- Specified by:
getHybridizationin interfaceIAtomType- Overrides:
getHybridizationin classAtomType- Returns:
- the hybridization of this atom
- See Also:
-
setCovalentRadius
Sets the covalent radius for this AtomType.- Specified by:
setCovalentRadiusin interfaceIAtomType- Overrides:
setCovalentRadiusin classAtomType- Parameters:
radius- The covalent radius for this AtomType- See Also:
-
getCovalentRadius
Returns the covalent radius for this AtomType.- Specified by:
getCovalentRadiusin interfaceIAtomType- Overrides:
getCovalentRadiusin classAtomType- Returns:
- The covalent radius for this AtomType
- See Also:
-
setValency
Sets the the exact electron valency of the AtomType object.- Specified by:
setValencyin interfaceIAtomType- Overrides:
setValencyin classAtomType- Parameters:
valency- The new valency value- See Also:
-
getValency
Gets the the exact electron valency of the AtomType object.- Specified by:
getValencyin interfaceIAtomType- Overrides:
getValencyin classAtomType- Returns:
- The valency value
- See Also:
-
setNaturalAbundance
Sets the NaturalAbundance attribute of the Isotope object.- Specified by:
setNaturalAbundancein interfaceIIsotope- Overrides:
setNaturalAbundancein classIsotope- Parameters:
naturalAbundance- The new NaturalAbundance value- See Also:
-
setExactMass
Sets the ExactMass attribute of the Isotope object.- Specified by:
setExactMassin interfaceIIsotope- Overrides:
setExactMassin classIsotope- Parameters:
exactMass- The new ExactMass value- See Also:
-
getNaturalAbundance
Gets the NaturalAbundance attribute of the Isotope object.Once instantiated all field not filled by passing parameters to the constructor are null. Isotopes can be configured by using the IsotopeFactory.configure() method:
Isotope isotope = new Isotope("C", 13); IsotopeFactory if = IsotopeFactory.getInstance(isotope.getNewBuilder()); if.configure(isotope);- Specified by:
getNaturalAbundancein interfaceIIsotope- Overrides:
getNaturalAbundancein classIsotope- Returns:
- The NaturalAbundance value
- See Also:
-
getExactMass
Gets the ExactMass attribute of the Isotope object.Once instantiated all field not filled by passing parameters to the constructor are null. Isotopes can be configured by using the IsotopeFactory.configure() method:
Isotope isotope = new Isotope("C", 13); IsotopeFactory if = IsotopeFactory.getInstance(isotope.getNewBuilder()); if.configure(isotope);- Specified by:
getExactMassin interfaceIIsotope- Overrides:
getExactMassin classIsotope- Returns:
- The ExactMass value
- See Also:
-
getMassNumber
Returns the atomic mass of this element.Once instantiated all field not filled by passing parameters to the constructor are null. Isotopes can be configured by using the IsotopeFactory.configure() method:
Isotope isotope = new Isotope("C", 13); IsotopeFactory if = IsotopeFactory.getInstance(isotope.getNewBuilder()); if.configure(isotope);- Specified by:
getMassNumberin interfaceIIsotope- Overrides:
getMassNumberin classIsotope- Returns:
- The atomic mass of this element
- See Also:
-
setMassNumber
Sets the atomic mass of this element.- Specified by:
setMassNumberin interfaceIIsotope- Overrides:
setMassNumberin classIsotope- Parameters:
massNumber- The atomic mass to be assigned to this element- See Also:
-
getAtomicNumber
Returns the atomic number of this element.Once instantiated all field not filled by passing parameters to the constructor are null. Elements can be configured by using the IsotopeFactory.configure() method:
Element element = new Element("C"); IsotopeFactory if = IsotopeFactory.getInstance(element.getNewBuilder()); if.configure(element);- Specified by:
getAtomicNumberin interfaceIElement- Overrides:
getAtomicNumberin classElement- Returns:
- The atomic number of this element
- See Also:
-
setAtomicNumber
Sets the atomic number of this element.- Specified by:
setAtomicNumberin interfaceIElement- Overrides:
setAtomicNumberin classElement- Parameters:
atomicNumber- The atomic mass to be assigned to this element- See Also:
-
getSymbol
Returns the element symbol of this element. -
setSymbol
Sets the element symbol of this element. -
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 atom object and its content.- Specified by:
clonein interfaceIAtom- Specified by:
clonein interfaceIChemObject- Overrides:
clonein classAtom- 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
-