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
public class DebugAtom extends Atom implements IAtom
Debugging data class.- Author:
- egonw
- See Also:
- Serialized Form
- Source code:
- main
- Belongs to CDK module:
- datadebug
-
-
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, stereoParity
-
Fields inherited from class org.openscience.cdk.AtomType
electronValency, formalCharge, formalNeighbourCount, hybridization
-
Fields inherited from class org.openscience.cdk.Isotope
exactMass, naturalAbundance
-
Fields inherited from class org.openscience.cdk.Element
atomicNumber
-
Fields 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(IChemObjectListener col)
Use this to add yourself to this IChemObject as a listener.void
addProperties(Map<Object,Object> properties)
Sets the properties of this object.Iterable<IBond>
bonds()
Returns the bonds connected to this atom.IAtom
clone()
Clones this atom object and its content.Integer
getAtomicNumber()
Returns the atomic number of this element.String
getAtomTypeName()
Gets the id attribute of the AtomType object.Double
getBondOrderSum()
Gets the bondOrderSum attribute of the AtomType object.IChemObjectBuilder
getBuilder()
Returns aIChemObjectBuilder
for the data classes that extend this class.Double
getCharge()
Returns the partial charge of this atom.IAtomContainer
getContainer()
Access theIAtomContainer
of which this atom is a member of.Double
getCovalentRadius()
Returns the covalent radius for this AtomType.Double
getExactMass()
Gets the ExactMass attribute of the Isotope object.boolean
getFlag(int flagType)
Returns the value of a given flag.boolean[]
getFlags()
Returns the whole set of flags.Integer
getFormalCharge()
Returns the formal charge of this atom.Integer
getFormalNeighbourCount()
Returns the formal neighbour count of this atom.javax.vecmath.Point3d
getFractionalPoint3d()
Returns a point specifying the location of this atom in a Crystal unit cell.IAtomType.Hybridization
getHybridization()
Returns the hybridization of this atom.String
getID()
Returns the identifier (ID) of this object.Integer
getImplicitHydrogenCount()
Returns the hydrogen count of this atom.int
getIndex()
Acces the index of an atom in the context of anIAtomContainer
.int
getListenerCount()
Returns the number of ChemObjectListeners registered with this object.Integer
getMassNumber()
Returns the atomic mass of this element.IBond.Order
getMaxBondOrder()
Gets the MaxBondOrder attribute of the AtomType object.Double
getNaturalAbundance()
Gets the NaturalAbundance attribute of the Isotope object.javax.vecmath.Point2d
getPoint2d()
Returns a point specifying the location of this atom in a 2D space.javax.vecmath.Point3d
getPoint3d()
Returns a point specifying the location of this atom in a 3D space.Map<Object,Object>
getProperties()
Returns a Map with the IChemObject's properties.<T> T
getProperty(Object description)
Returns a property for the IChemObject.Integer
getStereoParity()
Returns the stereo parity of this atom.String
getSymbol()
Returns the element symbol of this element.Integer
getValency()
Gets the the exact electron valency of the AtomType object.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.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.void
removeListener(IChemObjectListener col)
Use this to remove a ChemObjectListener from the ListenerList of this IChemObject.void
removeProperty(Object description)
Removes a property for a IChemObject.void
setAtomicNumber(Integer atomicNumber)
Sets the atomic number of this element.void
setAtomTypeName(String identifier)
Sets the if attribute of the AtomType object.void
setBondOrderSum(Double bondOrderSum)
Sets the the exact bond order sum attribute of the AtomType object.void
setCharge(Double charge)
Sets the partial charge of this atom.void
setCovalentRadius(Double radius)
Sets the covalent radius for this AtomType.void
setExactMass(Double exactMass)
Sets the ExactMass attribute of the Isotope object.void
setFlag(int flagType, boolean flagValue)
Sets the value of some flag.void
setFlags(boolean[] flagsNew)
Sets the whole set of flags.void
setFormalCharge(Integer charge)
Sets the formal charge of this atom.void
setFormalNeighbourCount(Integer count)
Sets the formal neighbour count of this atom.void
setFractionalPoint3d(javax.vecmath.Point3d point3d)
Sets a point specifying the location of this atom in a Crystal unit cell.void
setHybridization(IAtomType.Hybridization hybridization)
Sets the hybridization of this atom.void
setID(String identifier)
Sets the identifier (ID) of this object.void
setImplicitHydrogenCount(Integer hydrogenCount)
Sets the number of implicit hydrogen count of this atom.void
setMassNumber(Integer massNumber)
Sets the atomic mass of this element.void
setMaxBondOrder(IBond.Order maxBondOrder)
Sets the MaxBondOrder attribute of the AtomType object.void
setNaturalAbundance(Double naturalAbundance)
Sets the NaturalAbundance attribute of the Isotope object.void
setPoint2d(javax.vecmath.Point2d point2d)
Sets a point specifying the location of this atom in a 2D space.void
setPoint3d(javax.vecmath.Point3d point3d)
Sets a point specifying the location of this atom in 3D space.void
setProperty(Object description, Object property)
Sets a property for a IChemObject.void
setStereoParity(Integer stereoParity)
Sets the stereo parity for this atom.void
setSymbol(String symbol)
Sets the element symbol of this element.void
setValency(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, isAromatic, isInRing, setIsAromatic, setIsInRing, setMapIdx, toString
-
Methods inherited from class org.openscience.cdk.ChemObject
getFlagValue, getNotification, getProperty, setNotification, setProperties, shallowCopy
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openscience.cdk.interfaces.IAtom
getBond, getBondCount, getMapIdx, isAromatic, isInRing, setIsAromatic, setIsInRing, setMapIdx
-
Methods inherited from interface org.openscience.cdk.interfaces.IChemObject
getFlagValue, getNotification, getProperty, setNotification, setProperties, toString
-
-
-
-
Method Detail
-
getContainer
public IAtomContainer getContainer()
Access theIAtomContainer
of 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:
getContainer
in interfaceIAtom
- Overrides:
getContainer
in 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
public Iterable<IBond> 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
public void setCharge(Double charge)
Sets the partial charge of this atom.- Specified by:
setCharge
in interfaceIAtom
- Overrides:
setCharge
in classAtom
- Parameters:
charge
- The partial charge- See Also:
Atom.getCharge()
-
getCharge
public Double getCharge()
Returns the partial charge of this atom. If the charge has not been set the return value is Double.NaN- Specified by:
getCharge
in interfaceIAtom
- Overrides:
getCharge
in classAtom
- Returns:
- the charge of this atom
- See Also:
Atom.setCharge(java.lang.Double)
-
setImplicitHydrogenCount
public void setImplicitHydrogenCount(Integer hydrogenCount)
Sets the number of implicit hydrogen count of this atom.- Specified by:
setImplicitHydrogenCount
in interfaceIAtom
- Overrides:
setImplicitHydrogenCount
in classAtom
- Parameters:
hydrogenCount
- The number of hydrogen atoms bonded to this atom.- See Also:
Atom.getImplicitHydrogenCount()
-
getImplicitHydrogenCount
public Integer getImplicitHydrogenCount()
Returns the hydrogen count of this atom.- Specified by:
getImplicitHydrogenCount
in interfaceIAtom
- Overrides:
getImplicitHydrogenCount
in classAtom
- Returns:
- The hydrogen count of this atom.
- See Also:
Atom.setImplicitHydrogenCount(java.lang.Integer)
-
setPoint2d
public void setPoint2d(javax.vecmath.Point2d point2d)
Sets a point specifying the location of this atom in a 2D space.- Specified by:
setPoint2d
in interfaceIAtom
- Overrides:
setPoint2d
in classAtom
- Parameters:
point2d
- A point in a 2D plane- See Also:
Atom.getPoint2d()
-
setPoint3d
public void setPoint3d(javax.vecmath.Point3d point3d)
Sets a point specifying the location of this atom in 3D space.- Specified by:
setPoint3d
in interfaceIAtom
- Overrides:
setPoint3d
in classAtom
- Parameters:
point3d
- A point in a 3-dimensional space- See Also:
Atom.getPoint3d()
-
setFractionalPoint3d
public void setFractionalPoint3d(javax.vecmath.Point3d point3d)
Sets a point specifying the location of this atom in a Crystal unit cell.- Specified by:
setFractionalPoint3d
in interfaceIAtom
- Overrides:
setFractionalPoint3d
in classAtom
- Parameters:
point3d
- A point in a 3d fractional unit cell space- See Also:
Atom.getFractionalPoint3d()
,Crystal
-
setStereoParity
public void setStereoParity(Integer stereoParity)
Sets the stereo parity for this atom.- Specified by:
setStereoParity
in interfaceIAtom
- Overrides:
setStereoParity
in classAtom
- Parameters:
stereoParity
- The stereo parity for this atom- See Also:
for predefined values.
,Atom.getStereoParity()
-
getPoint2d
public javax.vecmath.Point2d getPoint2d()
Returns a point specifying the location of this atom in a 2D space.- Specified by:
getPoint2d
in interfaceIAtom
- Overrides:
getPoint2d
in classAtom
- Returns:
- A point in a 2D plane. Null if unset.
- See Also:
Atom.setPoint2d(javax.vecmath.Point2d)
-
getPoint3d
public javax.vecmath.Point3d getPoint3d()
Returns a point specifying the location of this atom in a 3D space.- Specified by:
getPoint3d
in interfaceIAtom
- Overrides:
getPoint3d
in classAtom
- Returns:
- A point in 3-dimensional space. Null if unset.
- See Also:
Atom.setPoint3d(javax.vecmath.Point3d)
-
getFractionalPoint3d
public javax.vecmath.Point3d getFractionalPoint3d()
Returns a point specifying the location of this atom in a Crystal unit cell.- Specified by:
getFractionalPoint3d
in interfaceIAtom
- Overrides:
getFractionalPoint3d
in classAtom
- Returns:
- A point in 3d fractional unit cell space. Null if unset.
- See Also:
Atom.setFractionalPoint3d(javax.vecmath.Point3d)
,for predefined values.
-
getStereoParity
public Integer getStereoParity()
Returns the stereo parity of this atom. It uses the predefined values found in CDKConstants.- Specified by:
getStereoParity
in interfaceIAtom
- Overrides:
getStereoParity
in classAtom
- Returns:
- The stereo parity for this atom
- See Also:
CDKConstants
,Atom.setStereoParity(java.lang.Integer)
-
setAtomTypeName
public void setAtomTypeName(String identifier)
Sets the if attribute of the AtomType object.- Specified by:
setAtomTypeName
in interfaceIAtomType
- Overrides:
setAtomTypeName
in classAtomType
- Parameters:
identifier
- The new AtomTypeID value. Null if unset.- See Also:
AtomType.getAtomTypeName()
-
setMaxBondOrder
public void setMaxBondOrder(IBond.Order maxBondOrder)
Sets the MaxBondOrder attribute of the AtomType object.- Specified by:
setMaxBondOrder
in interfaceIAtomType
- Overrides:
setMaxBondOrder
in classAtomType
- Parameters:
maxBondOrder
- The new MaxBondOrder value- See Also:
AtomType.getMaxBondOrder()
-
setBondOrderSum
public void setBondOrderSum(Double bondOrderSum)
Sets the the exact bond order sum attribute of the AtomType object.- Specified by:
setBondOrderSum
in interfaceIAtomType
- Overrides:
setBondOrderSum
in classAtomType
- Parameters:
bondOrderSum
- The new bondOrderSum value- See Also:
AtomType.getBondOrderSum()
-
getAtomTypeName
public String getAtomTypeName()
Gets the id attribute of the AtomType object.- Specified by:
getAtomTypeName
in interfaceIAtomType
- Overrides:
getAtomTypeName
in classAtomType
- Returns:
- The id value
- See Also:
AtomType.setAtomTypeName(java.lang.String)
-
getMaxBondOrder
public IBond.Order getMaxBondOrder()
Gets the MaxBondOrder attribute of the AtomType object.- Specified by:
getMaxBondOrder
in interfaceIAtomType
- Overrides:
getMaxBondOrder
in classAtomType
- Returns:
- The MaxBondOrder value
- See Also:
AtomType.setMaxBondOrder(org.openscience.cdk.interfaces.IBond.Order)
-
getBondOrderSum
public Double getBondOrderSum()
Gets the bondOrderSum attribute of the AtomType object.- Specified by:
getBondOrderSum
in interfaceIAtomType
- Overrides:
getBondOrderSum
in classAtomType
- Returns:
- The bondOrderSum value
- See Also:
AtomType.setBondOrderSum(java.lang.Double)
-
setFormalCharge
public void setFormalCharge(Integer charge)
Sets the formal charge of this atom.- Specified by:
setFormalCharge
in interfaceIAtomType
- Overrides:
setFormalCharge
in classAtomType
- Parameters:
charge
- The formal charge- See Also:
AtomType.getFormalCharge()
-
getFormalCharge
public Integer getFormalCharge()
Returns the formal charge of this atom.- Specified by:
getFormalCharge
in interfaceIAtomType
- Overrides:
getFormalCharge
in classAtomType
- Returns:
- the formal charge of this atom
- See Also:
AtomType.setFormalCharge(java.lang.Integer)
-
setFormalNeighbourCount
public void setFormalNeighbourCount(Integer count)
Sets the formal neighbour count of this atom.- Specified by:
setFormalNeighbourCount
in interfaceIAtomType
- Overrides:
setFormalNeighbourCount
in classAtomType
- Parameters:
count
- The neighbour count- See Also:
AtomType.getFormalNeighbourCount()
-
getFormalNeighbourCount
public Integer getFormalNeighbourCount()
Returns the formal neighbour count of this atom.- Specified by:
getFormalNeighbourCount
in interfaceIAtomType
- Overrides:
getFormalNeighbourCount
in classAtomType
- Returns:
- the formal neighbour count of this atom
- See Also:
AtomType.setFormalNeighbourCount(java.lang.Integer)
-
setHybridization
public void setHybridization(IAtomType.Hybridization hybridization)
Sets the hybridization of this atom.- Specified by:
setHybridization
in interfaceIAtomType
- Overrides:
setHybridization
in classAtomType
- Parameters:
hybridization
- The hybridization- See Also:
AtomType.getHybridization()
-
getHybridization
public IAtomType.Hybridization getHybridization()
Returns the hybridization of this atom.- Specified by:
getHybridization
in interfaceIAtomType
- Overrides:
getHybridization
in classAtomType
- Returns:
- the hybridization of this atom
- See Also:
AtomType.setHybridization(org.openscience.cdk.interfaces.IAtomType.Hybridization)
-
setCovalentRadius
public void setCovalentRadius(Double radius)
Sets the covalent radius for this AtomType.- Specified by:
setCovalentRadius
in interfaceIAtomType
- Overrides:
setCovalentRadius
in classAtomType
- Parameters:
radius
- The covalent radius for this AtomType- See Also:
AtomType.getCovalentRadius()
-
getCovalentRadius
public Double getCovalentRadius()
Returns the covalent radius for this AtomType.- Specified by:
getCovalentRadius
in interfaceIAtomType
- Overrides:
getCovalentRadius
in classAtomType
- Returns:
- The covalent radius for this AtomType
- See Also:
AtomType.setCovalentRadius(java.lang.Double)
-
setValency
public void setValency(Integer valency)
Sets the the exact electron valency of the AtomType object.- Specified by:
setValency
in interfaceIAtomType
- Overrides:
setValency
in classAtomType
- Parameters:
valency
- The new valency value- See Also:
AtomType.getValency()
-
getValency
public Integer getValency()
Gets the the exact electron valency of the AtomType object.- Specified by:
getValency
in interfaceIAtomType
- Overrides:
getValency
in classAtomType
- Returns:
- The valency value
- See Also:
AtomType.setValency(java.lang.Integer)
-
setNaturalAbundance
public void setNaturalAbundance(Double naturalAbundance)
Sets the NaturalAbundance attribute of the Isotope object.- Specified by:
setNaturalAbundance
in interfaceIIsotope
- Overrides:
setNaturalAbundance
in classIsotope
- Parameters:
naturalAbundance
- The new NaturalAbundance value- See Also:
Isotope.getNaturalAbundance()
-
setExactMass
public void setExactMass(Double exactMass)
Sets the ExactMass attribute of the Isotope object.- Specified by:
setExactMass
in interfaceIIsotope
- Overrides:
setExactMass
in classIsotope
- Parameters:
exactMass
- The new ExactMass value- See Also:
Isotope.getExactMass()
-
getNaturalAbundance
public Double 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:
getNaturalAbundance
in interfaceIIsotope
- Overrides:
getNaturalAbundance
in classIsotope
- Returns:
- The NaturalAbundance value
- See Also:
Isotope.setNaturalAbundance(java.lang.Double)
-
getExactMass
public Double 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:
getExactMass
in interfaceIIsotope
- Overrides:
getExactMass
in classIsotope
- Returns:
- The ExactMass value
- See Also:
Isotope.setExactMass(java.lang.Double)
-
getMassNumber
public Integer 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:
getMassNumber
in interfaceIIsotope
- Overrides:
getMassNumber
in classIsotope
- Returns:
- The atomic mass of this element
- See Also:
Isotope.setMassNumber(Integer)
-
setMassNumber
public void setMassNumber(Integer massNumber)
Sets the atomic mass of this element.- Specified by:
setMassNumber
in interfaceIIsotope
- Overrides:
setMassNumber
in classIsotope
- Parameters:
massNumber
- The atomic mass to be assigned to this element- See Also:
Isotope.getMassNumber()
-
getAtomicNumber
public Integer 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:
getAtomicNumber
in interfaceIElement
- Overrides:
getAtomicNumber
in classElement
- Returns:
- The atomic number of this element
- See Also:
Element.setAtomicNumber(java.lang.Integer)
-
setAtomicNumber
public void setAtomicNumber(Integer atomicNumber)
Sets the atomic number of this element.- Specified by:
setAtomicNumber
in interfaceIElement
- Overrides:
setAtomicNumber
in classElement
- Parameters:
atomicNumber
- The atomic mass to be assigned to this element- See Also:
Element.getAtomicNumber()
-
getSymbol
public String getSymbol()
Returns the element symbol of this element.- Specified by:
getSymbol
in interfaceIElement
- Overrides:
getSymbol
in classElement
- Returns:
- The element symbol of this element. Null if unset.
- See Also:
Element.setSymbol(java.lang.String)
-
setSymbol
public void setSymbol(String symbol)
Sets the element symbol of this element.- Specified by:
setSymbol
in interfaceIElement
- Overrides:
setSymbol
in classElement
- Parameters:
symbol
- The element symbol to be assigned to this atom- See Also:
Element.getSymbol()
-
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:
addListener
in interfaceIChemObject
- Overrides:
addListener
in 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:
getListenerCount
in interfaceIChemObject
- Overrides:
getListenerCount
in 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:
removeListener
in interfaceIChemObject
- Overrides:
removeListener
in 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:
notifyChanged
in interfaceIChemObject
- Overrides:
notifyChanged
in 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:
notifyChanged
in interfaceIChemObject
- Overrides:
notifyChanged
in 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:
setProperty
in interfaceIChemObject
- Overrides:
setProperty
in 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:
removeProperty
in interfaceIChemObject
- Overrides:
removeProperty
in 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:
getProperty
in interfaceIChemObject
- Overrides:
getProperty
in 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:
getProperties
in interfaceIChemObject
- Overrides:
getProperties
in 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:
getID
in interfaceIChemObject
- Overrides:
getID
in 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:
setID
in interfaceIChemObject
- Overrides:
setID
in 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.CDKConstants.ISAROMATIC
orCDKConstants.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:
setFlag
in interfaceIChemObject
- Overrides:
setFlag
in classChemObject
- Parameters:
flagType
- flag to set the value forflagValue
- value to assign to flag- See Also:
IChemObject.getFlag(int)
,CDKConstants
-
getFlag
public boolean getFlag(int flagType)
Returns the value of a given flag. The flag is a mask from a given CDKConstant (e.g.CDKConstants.ISAROMATIC
).if(chemObject.getFlag(CDKConstants.ISAROMATIC)){ // handle aromatic flag on this chem object }
- Specified by:
getFlag
in interfaceIChemObject
- Overrides:
getFlag
in classChemObject
- Parameters:
flagType
- flag to retrieve the value of- Returns:
- true if the flag
flag_type
is set - See Also:
IChemObject.setFlag(int, boolean)
,CDKConstants
-
addProperties
public void addProperties(Map<Object,Object> properties)
Sets the properties of this object.- Specified by:
addProperties
in interfaceIChemObject
- Overrides:
addProperties
in 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:
setFlags
in interfaceIChemObject
- Overrides:
setFlags
in classChemObject
- Parameters:
flagsNew
- the new flags.- See Also:
ChemObject.getFlags()
-
getFlags
public boolean[] getFlags()
Returns the whole set of flags.- Specified by:
getFlags
in interfaceIChemObject
- Overrides:
getFlags
in classChemObject
- Returns:
- the flags.
- See Also:
ChemObject.setFlags(boolean[])
-
clone
public IAtom clone() throws CloneNotSupportedException
Clones this atom object and its content.- Specified by:
clone
in interfaceIAtom
- Specified by:
clone
in interfaceIChemObject
- Overrides:
clone
in classAtom
- Returns:
- The cloned object
- Throws:
CloneNotSupportedException
- if the IChemObject cannot be cloned
-
getBuilder
public IChemObjectBuilder getBuilder()
Returns aIChemObjectBuilder
for the data classes that extend this class.- Specified by:
getBuilder
in interfaceICDKObject
- Overrides:
getBuilder
in classChemObject
- Returns:
- The
IChemObjectBuilder
matching thisICDKObject
-
-