public class AtomRef extends Object implements IAtom
IAtom indirectly. All
methods are passed through to the referenced atom. The reference can
be used to override the behaviour of the base atom.IAtomType.HybridizationAc, 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 and Description |
|---|
AtomRef(IAtom atom)
Create a pointer for the provided atom.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(IChemObjectListener col)
Use this to add yourself to this IChemObject as a listener.
|
void |
addProperties(Map<Object,Object> properties)
Add properties to this object, duplicate keys will replace any existing
value.
|
Iterable<IBond> |
bonds()
Returns the bonds connected to this atom.
|
IAtom |
clone()
Returns a deep clone of this IChemObject.
|
IAtom |
deref()
Dereference the atom pointer once providing access to the base
atom.
|
static IAtom |
deref(IAtom atom)
Utility method to dereference an atom.
|
boolean |
equals(Object obj) |
Integer |
getAtomicNumber()
Returns the atomic number of this element.
|
String |
getAtomTypeName()
Gets the id attribute of the AtomType object.
|
IBond |
getBond(IAtom atom)
Returns the bond connecting 'this' atom to the provided atom.
|
int |
getBondCount()
Get the number of explicit bonds connected to this atom.
|
Double |
getBondOrderSum()
Gets the bondOrderSum attribute of the AtomType object.
|
IChemObjectBuilder |
getBuilder()
Returns a
IChemObjectBuilder for the data classes that extend
this class. |
Double |
getCharge()
Returns the partial charge of this atom.
|
IAtomContainer |
getContainer()
Access the
IAtomContainer 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 mask)
Returns the value of a given flag.
|
boolean[] |
getFlags()
Returns the whole set of flags.
|
Number |
getFlagValue()
Access the internal value used to store the 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 implicit hydrogen count of this atom.
|
int |
getIndex()
Acces the index of an atom in the context of an
IAtomContainer. |
int |
getListenerCount()
Returns the number of ChemObjectListeners registered with this object.
|
int |
getMapIdx()
Access the map index for this atom.
|
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.
|
boolean |
getNotification()
Returns the flag that indicates whether notification messages are sent around.
|
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 - the object is automatically
cast to the required type.
|
<T> T |
getProperty(Object description,
Class<T> c)
Access a property of the given description and cast the specified class.
|
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.
|
int |
hashCode() |
boolean |
isAromatic()
Access whether this atom has been marked as aromatic.
|
boolean |
isInRing()
Access whether this atom has been flagged as in a ring.
|
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 mask,
boolean value)
Sets the value of some flag.
|
void |
setFlags(boolean[] newFlags)
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 implicit hydrogen count of this atom.
|
void |
setIsAromatic(boolean arom)
Mark this atom as being aromatic.
|
void |
setIsInRing(boolean ring)
Mark this atom as being in a ring.
|
void |
setMapIdx(int mapidx)
Set the map index for 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 |
setNotification(boolean bool)
Set a flag to use or not use notification.
|
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 |
setProperties(Map<Object,Object> properties)
Set the properties of this object to the provided map (shallow copy).
|
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.
|
String |
toString()
Returns a one line description of this IChemObject.
|
finalize, getClass, notify, notifyAll, wait, wait, waitaddListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setPropertygetBuilderpublic AtomRef(IAtom atom)
atom - the atom to referencepublic static IAtom deref(IAtom atom)
AtomRef it simply returns the input.atom - the atompublic IAtom deref()
public Double getCharge()
getCharge in interface IAtomIAtom.setCharge(java.lang.Double)public void setCharge(Double charge)
setCharge in interface IAtomcharge - The partial chargeIAtom.getCharge()public Integer getAtomicNumber()
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);
getAtomicNumber in interface IElementIElement.setAtomicNumber(java.lang.Integer)public void setAtomicNumber(Integer atomicNumber)
setAtomicNumber in interface IElementatomicNumber - The atomic mass to be assigned to this elementIElement.getAtomicNumber()public Double getNaturalAbundance()
getNaturalAbundance in interface IIsotopeIIsotope.setNaturalAbundance(java.lang.Double)public void setNaturalAbundance(Double naturalAbundance)
setNaturalAbundance in interface IIsotopenaturalAbundance - The new NaturalAbundance valueIIsotope.getNaturalAbundance()public Integer getImplicitHydrogenCount()
getImplicitHydrogenCount in interface IAtomIAtom.setImplicitHydrogenCount(java.lang.Integer)public void setImplicitHydrogenCount(Integer hydrogenCount)
setImplicitHydrogenCount in interface IAtomhydrogenCount - The number of hydrogen atoms bonded to this atom.IAtom.getImplicitHydrogenCount()public Double getExactMass()
getExactMass in interface IIsotopeIIsotope.setExactMass(java.lang.Double)public void setExactMass(Double exactMass)
setExactMass in interface IIsotopeexactMass - The new ExactMass valueIIsotope.getExactMass()public String getSymbol()
getSymbol in interface IElementIElement.setSymbol(java.lang.String)public void setSymbol(String symbol)
setSymbol in interface IElementsymbol - The element symbol to be assigned to this atomIElement.getSymbol()public Integer getMassNumber()
getMassNumber in interface IIsotopeIIsotope.setMassNumber(Integer)public void setMassNumber(Integer massNumber)
setMassNumber in interface IIsotopemassNumber - The atomic mass to be assigned to this elementIIsotope.getMassNumber()public String getAtomTypeName()
getAtomTypeName in interface IAtomTypeIAtomType.setAtomTypeName(java.lang.String)public void setAtomTypeName(String identifier)
setAtomTypeName in interface IAtomTypeidentifier - The new AtomTypeID value. Null if unset.IAtomType.getAtomTypeName()public IBond.Order getMaxBondOrder()
getMaxBondOrder in interface IAtomTypeIAtomType.setMaxBondOrder(org.openscience.cdk.interfaces.IBond.Order)public void setMaxBondOrder(IBond.Order maxBondOrder)
setMaxBondOrder in interface IAtomTypemaxBondOrder - The new MaxBondOrder valueIAtomType.getMaxBondOrder()public Double getBondOrderSum()
getBondOrderSum in interface IAtomTypeIAtomType.setBondOrderSum(java.lang.Double)public void setBondOrderSum(Double bondOrderSum)
setBondOrderSum in interface IAtomTypebondOrderSum - The new bondOrderSum valueIAtomType.getBondOrderSum()public javax.vecmath.Point2d getPoint2d()
getPoint2d in interface IAtomIAtom.setPoint2d(javax.vecmath.Point2d)public void setPoint2d(javax.vecmath.Point2d point2d)
setPoint2d in interface IAtompoint2d - A point in a 2D planeIAtom.getPoint2d()public javax.vecmath.Point3d getPoint3d()
getPoint3d in interface IAtomIAtom.setPoint3d(javax.vecmath.Point3d)public void setPoint3d(javax.vecmath.Point3d point3d)
setPoint3d in interface IAtompoint3d - A point in a 3-dimensional spaceIAtom.getPoint3d()public Integer getFormalCharge()
getFormalCharge in interface IAtomTypeIAtomType.setFormalCharge(java.lang.Integer)public void setFormalCharge(Integer charge)
setFormalCharge in interface IAtomTypecharge - The formal chargeIAtomType.getFormalCharge()public javax.vecmath.Point3d getFractionalPoint3d()
getFractionalPoint3d in interface IAtomIAtom.setFractionalPoint3d(javax.vecmath.Point3d),
for predefined values.public void setFractionalPoint3d(javax.vecmath.Point3d point3d)
setFractionalPoint3d in interface IAtompoint3d - A point in a 3d fractional unit cell spaceIAtom.getFractionalPoint3d(),
Crystalpublic Integer getFormalNeighbourCount()
getFormalNeighbourCount in interface IAtomTypeIAtomType.setFormalNeighbourCount(java.lang.Integer)public void setFormalNeighbourCount(Integer count)
setFormalNeighbourCount in interface IAtomTypecount - The neighbour countIAtomType.getFormalNeighbourCount()public Integer getStereoParity()
getStereoParity in interface IAtomCDKConstants,
IAtom.setStereoParity(java.lang.Integer)public void setStereoParity(Integer stereoParity)
setStereoParity in interface IAtomstereoParity - The stereo parity for this atomfor predefined values.,
IAtom.getStereoParity()public IAtomType.Hybridization getHybridization()
getHybridization in interface IAtomTypeIAtomType.setHybridization(org.openscience.cdk.interfaces.IAtomType.Hybridization)public void setHybridization(IAtomType.Hybridization hybridization)
setHybridization in interface IAtomTypehybridization - The hybridizationIAtomType.getHybridization()public Double getCovalentRadius()
getCovalentRadius in interface IAtomTypeIAtomType.setCovalentRadius(java.lang.Double)public void setCovalentRadius(Double radius)
setCovalentRadius in interface IAtomTyperadius - The covalent radius for this AtomTypeIAtomType.getCovalentRadius()public IAtomContainer getContainer()
IAtomContainer 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 an IAtomContainer, 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'
getContainer in interface IAtompublic int getIndex()
IAtomContainer. If the
index is not known, < 0 is returned.public Integer getValency()
getValency in interface IAtomTypeIAtomType.setValency(Integer)public void setValency(Integer valency)
setValency in interface IAtomTypevalency - The new valency valueIAtomType.getValency()public Iterable<IBond> bonds()
IAtomIAtom.getIndex() returns < 0 or IAtom.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()) {
}
public int getBondCount()
IAtomgetBondCount in interface IAtompublic IBond getBond(IAtom atom)
public boolean isAromatic()
isAromatic in interface IAtomIChemObject.getFlag(int),
Aromaticitypublic void setIsAromatic(boolean arom)
setIsAromatic in interface IAtomarom - aromatic statusIChemObject.setFlag(int, boolean)public boolean isInRing()
isInRing in interface IAtomIChemObject.getFlag(int),
RingSearchpublic void setIsInRing(boolean ring)
setIsInRing in interface IAtomring - ring statusIChemObject.setFlag(int, boolean)public int getMapIdx()
IAtompublic void setMapIdx(int mapidx)
IAtompublic IAtom clone() throws CloneNotSupportedException
clone in interface IAtomclone in interface IChemObjectCloneNotSupportedException - if the IChemObject cannot be clonedpublic String toString()
IChemObjecttoString in interface IChemObjecttoString in class Objectpublic IChemObjectBuilder getBuilder()
IChemObjectBuilder for the data classes that extend
this class.getBuilder in interface ICDKObjectIChemObjectBuilder matching this ICDKObjectpublic void addListener(IChemObjectListener col)
addListener in interface IChemObjectcol - the ChemObjectListenerIChemObject.removeListener(org.openscience.cdk.interfaces.IChemObjectListener)public int getListenerCount()
getListenerCount in interface IChemObjectpublic void removeListener(IChemObjectListener col)
removeListener in interface IChemObjectcol - The ChemObjectListener to be removedIChemObject.addListener(org.openscience.cdk.interfaces.IChemObjectListener)public void setNotification(boolean bool)
setNotification in interface IChemObjectbool - if true, then notification messages are sent.IChemObject.getNotification()public boolean getNotification()
getNotification in interface IChemObjectIChemObject.setNotification(boolean)public void notifyChanged()
notifyChanged in interface IChemObjectpublic void notifyChanged(IChemObjectChangeEvent evt)
notifyChanged in interface IChemObjectevt - A ChemObjectChangeEvent pointing to the source of where
the change happendpublic void setProperty(Object description, Object property)
setProperty in interface IChemObjectdescription - An object description of the property (most likely a
unique string)property - An object with the property itselfIChemObject.getProperty(java.lang.Object),
IChemObject.removeProperty(java.lang.Object)public void removeProperty(Object description)
removeProperty in interface IChemObjectdescription - The object description of the property (most likely a
unique string)IChemObject.setProperty(java.lang.Object, java.lang.Object),
IChemObject.getProperty(java.lang.Object)public <T> T getProperty(Object description)
IAtom atom = new Atom("C");
atom.setProperty("number", 1); // set an integer property
// access the property and automatically cast to an int
Integer number = atom.getProperty("number");
// if the method is in a chain or needs to be nested the type
// can be provided
methodAcceptingInt(atom.getProperty("number", Integer.class));
// the type cannot be checked and so...
String number = atom.getProperty("number"); // ClassCastException
// if the type is provided a more meaningful error is thrown
atom.getProperty("number", String.class); // IllegalArgumentException
getProperty in interface IChemObjectT - generic return typedescription - An object description of the property (most likely a
unique string)IChemObject.setProperty(java.lang.Object, java.lang.Object),
IChemObject.getProperty(Object, Class),
IChemObject.removeProperty(java.lang.Object)public <T> T getProperty(Object description, Class<T> c)
IAtom atom = new Atom("C");
atom.setProperty("number", 1); // set an integer property
// access the property and automatically cast to an int
Integer number = atom.getProperty("number");
// if the method is in a chain or needs to be nested the type
// can be provided
methodAcceptingInt(atom.getProperty("number", Integer.class));
// the type cannot be checked and so...
String number = atom.getProperty("number"); // ClassCastException
// if the type is provided a more meaningful error is thrown
atom.getProperty("number", String.class); // IllegalArgumentException
getProperty in interface IChemObjectT - generic type (of provided class)description - description of a property (normally a string)c - type of the value to be returnedIChemObject.getProperty(Object),
IChemObject.addProperties(java.util.Map)public Map<Object,Object> getProperties()
getProperties in interface IChemObjectIChemObject.addProperties(java.util.Map<java.lang.Object, java.lang.Object>)public String getID()
getID in interface IChemObjectIChemObject.setID(java.lang.String)public void setID(String identifier)
setID in interface IChemObjectidentifier - a String representing the ID valueIChemObject.getID()public void setFlag(int mask,
boolean value)
CDKConstants.ISAROMATIC
or CDKConstants.VISITED). The flags are
intrinsic internal properties and should not be used to store custom
values, please use IChemObject.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);
setFlag in interface IChemObjectmask - flag to set the value forvalue - value to assign to flagIChemObject.getFlag(int),
CDKConstantspublic boolean getFlag(int mask)
CDKConstants.ISAROMATIC).
if(chemObject.getFlag(CDKConstants.ISAROMATIC)){
// handle aromatic flag on this chem object
}
getFlag in interface IChemObjectmask - flag to retrieve the value offlag_type is setIChemObject.setFlag(int, boolean),
CDKConstantspublic void setProperties(Map<Object,Object> properties)
setProperties in interface IChemObjectproperties - map key-value pairspublic void addProperties(Map<Object,Object> properties)
addProperties in interface IChemObjectproperties - a Map specifying the property valuesIChemObject.getProperties()public void setFlags(boolean[] newFlags)
IChemObject.setFlag(int, boolean) for each value in the array and
use CDKConstants.FLAG_MASKS to look
up the correct mask. If only a single flag is being set it is a lot
faster to use IChemObject.setFlag(int, boolean).setFlags in interface IChemObjectnewFlags - the new flags to set.IChemObject.setFlag(int, boolean),
IChemObject.getFlags()public boolean[] getFlags()
IChemObject.getFlagValue()
if you need all the flags. For individual flags please use IChemObject.getFlag(int)getFlags in interface IChemObjectIChemObject.setFlags(boolean[]),
IChemObject.getFlag(int),
IChemObject.getFlagValue()public Number getFlagValue()
getFlagValue in interface IChemObjectCopyright © 2021. All rights reserved.