Package org.openscience.cdk
Class AtomRef
java.lang.Object
org.openscience.cdk.AtomRef
- All Implemented Interfaces:
Cloneable,IAtom,IAtomType,ICDKObject,IChemObject,IElement,IIsotope
An atom ref, references a CDK
IAtom indirectly. All
methods are passed through to the referenced atom. The reference can
be used to override the behaviour of the base atom.- Author:
- John Mayfield
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openscience.cdk.interfaces.IAtomType
IAtomType.Hybridization -
Field Summary
Fields 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) Add properties to this object, duplicate keys will replace any existing value.bonds()Returns the bonds connected to this atom.voidclear(int flags) Clear the provided flags.clone()Returns a deep clone of this IChemObject.deref()Dereference the atom pointer once providing access to the base atom.static IAtomUtility method to dereference an atom.booleanintflags()Access the current value of the flags for this ChemObject.Returns the atomic number of this element.Gets the id attribute of the AtomType object.Returns the bond connecting 'this' atom to the provided atom.intGet the number of explicit bonds connected to this atom.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 mask) Returns the value of a given flag.boolean[]getFlags()Returns the whole set of flags.Access the internal value used to store the 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 implicit 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.intAccess the map index for this atom.Returns the atomic mass of this element.Gets the MaxBondOrder attribute of the AtomType object.Gets the NaturalAbundance attribute of the Isotope object.booleanReturns the flag that indicates whether notification messages are sent around.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 - the object is automatically cast to the required type.<T> TgetProperty(Object description, Class<T> c) Access a property of the given description and cast the specified class.Returns the stereo parity of this atom.Returns the element symbol of this element.Gets the the exact electron valency of the AtomType object.inthashCode()booleanis(int flags) Test if a flag(s) are set on this ChemObject.booleanAccess whether this atom has been marked as aromatic.booleanisInRing()Access whether this atom has been flagged as in a ring.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.voidset(int flags) Set the provided flags.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 mask, boolean value) Sets the value of some flag.voidsetFlags(boolean[] newFlags) 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 implicit hydrogen count of this atom.voidsetIsAromatic(boolean arom) Mark this atom as being aromatic.voidsetIsInRing(boolean ring) Mark this atom as being in a ring.voidsetMapIdx(int mapidx) Set the map index for 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.voidsetNotification(boolean bool) Set a flag to use or not use notification.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.voidsetProperties(Map<Object, Object> properties) Set the properties of this object to the provided map (shallow copy).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.toString()Returns a one line description of this IChemObject.Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openscience.cdk.interfaces.IAtom
getTotalHydrogenCount, neighborsMethods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilderMethods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, addProperties, clear, flags, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, is, notifyChanged, notifyChanged, removeListener, removeProperty, set, setFlag, setFlags, setID, setNotification, setProperties, setProperty
-
Constructor Details
-
AtomRef
Create a pointer for the provided atom.- Parameters:
atom- the atom to reference
-
-
Method Details
-
deref
Utility method to dereference an atom. If the atom is not anAtomRefit simply returns the input.- Parameters:
atom- the atom- Returns:
- non-pointer atom
-
deref
Dereference the atom pointer once providing access to the base atom.- Returns:
- the atom pointed to
-
getCharge
Returns the partial charge of this atom. -
setCharge
Sets the partial charge of this atom. -
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- Returns:
- The atomic number of this element
- See Also:
-
setAtomicNumber
Sets the atomic number of this element.- Specified by:
setAtomicNumberin interfaceIElement- Parameters:
atomicNumber- The atomic mass to be assigned to this element- See Also:
-
getNaturalAbundance
Gets the NaturalAbundance attribute of the Isotope object. Returns null when unconfigured.- Specified by:
getNaturalAbundancein interfaceIIsotope- Returns:
- The NaturalAbundance value
- See Also:
-
setNaturalAbundance
Sets the NaturalAbundance attribute of the Isotope object.- Specified by:
setNaturalAbundancein interfaceIIsotope- Parameters:
naturalAbundance- The new NaturalAbundance value- See Also:
-
getImplicitHydrogenCount
Returns the implicit hydrogen count of this atom.- Specified by:
getImplicitHydrogenCountin interfaceIAtom- Returns:
- The hydrogen count of this atom.
- See Also:
-
setImplicitHydrogenCount
Sets the implicit hydrogen count of this atom.- Specified by:
setImplicitHydrogenCountin interfaceIAtom- Parameters:
hydrogenCount- The number of hydrogen atoms bonded to this atom.- See Also:
-
getExactMass
Gets the ExactMass attribute of the Isotope object. Returns null when unconfigured.- Specified by:
getExactMassin interfaceIIsotope- Returns:
- The ExactMass value
- See Also:
-
setExactMass
Sets the ExactMass attribute of the Isotope object.- Specified by:
setExactMassin interfaceIIsotope- Parameters:
exactMass- The new ExactMass value- See Also:
-
getSymbol
Returns the element symbol of this element. -
setSymbol
Sets the element symbol of this element. -
getMassNumber
Returns the atomic mass of this element. Returns null when unconfigured.- Specified by:
getMassNumberin interfaceIIsotope- Returns:
- The atomic mass of this element
- See Also:
-
setMassNumber
Sets the atomic mass of this element.- Specified by:
setMassNumberin interfaceIIsotope- Parameters:
massNumber- The atomic mass to be assigned to this element- See Also:
-
getAtomTypeName
Gets the id attribute of the AtomType object.- Specified by:
getAtomTypeNamein interfaceIAtomType- Returns:
- The id value
- See Also:
-
setAtomTypeName
Sets the if attribute of the AtomType object.- Specified by:
setAtomTypeNamein interfaceIAtomType- Parameters:
identifier- The new AtomTypeID value. Null if unset.- See Also:
-
getMaxBondOrder
Gets the MaxBondOrder attribute of the AtomType object.- Specified by:
getMaxBondOrderin interfaceIAtomType- Returns:
- The MaxBondOrder value
- See Also:
-
setMaxBondOrder
Sets the MaxBondOrder attribute of the AtomType object.- Specified by:
setMaxBondOrderin interfaceIAtomType- Parameters:
maxBondOrder- The new MaxBondOrder value- See Also:
-
getBondOrderSum
Gets the bondOrderSum attribute of the AtomType object.- Specified by:
getBondOrderSumin interfaceIAtomType- Returns:
- The bondOrderSum value
- See Also:
-
setBondOrderSum
Sets the the exact bond order sum attribute of the AtomType object.- Specified by:
setBondOrderSumin interfaceIAtomType- Parameters:
bondOrderSum- The new bondOrderSum value- 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- Returns:
- A point in a 2D plane. Null if unset.
- 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- Parameters:
point2d- A point in a 2D plane- 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- Returns:
- A point in 3-dimensional space. Null if unset.
- 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- Parameters:
point3d- A point in a 3-dimensional space- See Also:
-
getFormalCharge
Returns the formal charge of this atom.- Specified by:
getFormalChargein interfaceIAtomType- Returns:
- the formal charge of this atom
- See Also:
-
setFormalCharge
Sets the formal charge of this atom.- Specified by:
setFormalChargein interfaceIAtomType- Parameters:
charge- The formal charge- 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- Returns:
- A point in 3d fractional unit cell space. Null if unset.
- 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- Parameters:
point3d- A point in a 3d fractional unit cell space- See Also:
-
getFormalNeighbourCount
Returns the formal neighbour count of this atom.- Specified by:
getFormalNeighbourCountin interfaceIAtomType- Returns:
- the formal neighbour count of this atom
- See Also:
-
setFormalNeighbourCount
Sets the formal neighbour count of this atom.- Specified by:
setFormalNeighbourCountin interfaceIAtomType- Parameters:
count- The neighbour count- See Also:
-
getStereoParity
Returns the stereo parity of this atom. It uses the predefined values found in CDKConstants.- Specified by:
getStereoParityin interfaceIAtom- Returns:
- The stereo parity for this atom
- See Also:
-
setStereoParity
Sets the stereo parity for this atom.- Specified by:
setStereoParityin interfaceIAtom- Parameters:
stereoParity- The stereo parity for this atom- See Also:
-
getHybridization
Returns the hybridization of this atom.- Specified by:
getHybridizationin interfaceIAtomType- Returns:
- the hybridization of this atom
- See Also:
-
setHybridization
Sets the hybridization of this atom.- Specified by:
setHybridizationin interfaceIAtomType- Parameters:
hybridization- The hybridization- See Also:
-
getCovalentRadius
Returns the covalent radius for this AtomType.- Specified by:
getCovalentRadiusin interfaceIAtomType- Returns:
- The covalent radius for this AtomType
- See Also:
-
setCovalentRadius
Sets the covalent radius for this AtomType.- Specified by:
setCovalentRadiusin interfaceIAtomType- Parameters:
radius- The covalent radius for this AtomType- See Also:
-
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- 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. -
getValency
Gets the the exact electron valency of the AtomType object.- Specified by:
getValencyin interfaceIAtomType- Returns:
- The valency value
- See Also:
-
setValency
Sets the the exact electron valency of the AtomType object.- Specified by:
setValencyin interfaceIAtomType- Parameters:
valency- The new valency value- See Also:
-
bonds
Description copied from interface:IAtomReturns 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()) { } -
getBondCount
public int getBondCount()Description copied from interface:IAtomGet the number of explicit bonds connected to this atom.- Specified by:
getBondCountin interfaceIAtom- Returns:
- the total bond count
-
getBond
Returns the bond connecting 'this' atom to the provided atom. If the atoms are not bonded, null is returned. -
isAromatic
public boolean isAromatic()Access whether this atom has been marked as aromatic. The default value is false and you must explicitly perceive aromaticity with one of the available models.- Specified by:
isAromaticin interfaceIAtom- Returns:
- aromatic status
- See Also:
-
setIsAromatic
public void setIsAromatic(boolean arom) Mark this atom as being aromatic.- Specified by:
setIsAromaticin interfaceIAtom- Parameters:
arom- aromatic status- See Also:
-
isInRing
public boolean isInRing()Access whether this atom has been flagged as in a ring. The default value is false and you must explicitly find rings first. -
setIsInRing
public void setIsInRing(boolean ring) Mark this atom as being in a ring.- Specified by:
setIsInRingin interfaceIAtom- Parameters:
ring- ring status- See Also:
-
getMapIdx
public int getMapIdx()Description copied from interface:IAtomAccess the map index for this atom. -
setMapIdx
public void setMapIdx(int mapidx) Description copied from interface:IAtomSet the map index for this atom. -
hashCode
public int hashCode() -
equals
-
clone
Returns a deep clone of this IChemObject.- Specified by:
clonein interfaceIAtom- Specified by:
clonein interfaceIChemObject- Returns:
- Object the clone of this IChemObject.
- Throws:
CloneNotSupportedException- if the IChemObject cannot be cloned
-
toString
Description copied from interface:IChemObjectReturns a one line description of this IChemObject.- Specified by:
toStringin interfaceIChemObject- Overrides:
toStringin classObject- Returns:
- a String representation of this object
-
getBuilder
Returns aIChemObjectBuilderfor the data classes that extend this class.- Specified by:
getBuilderin interfaceICDKObject- Returns:
- The
IChemObjectBuildermatching thisICDKObject
-
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- Parameters:
col- the ChemObjectListener- See Also:
-
getListenerCount
public int getListenerCount()Returns the number of ChemObjectListeners registered with this object.- Specified by:
getListenerCountin interfaceIChemObject- 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- Parameters:
col- The ChemObjectListener to be removed- See Also:
-
setNotification
public void setNotification(boolean bool) Set a flag to use or not use notification. By default it should be set to true.- Specified by:
setNotificationin interfaceIChemObject- Parameters:
bool- if true, then notification messages are sent.- See Also:
-
getNotification
public boolean getNotification()Returns the flag that indicates whether notification messages are sent around.- Specified by:
getNotificationin interfaceIChemObject- Returns:
- true if messages are sent.
- 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
-
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- Parameters:
evt- A ChemObjectChangeEvent pointing to the source of where the change happend
-
setProperty
Sets a property for a IChemObject.- Specified by:
setPropertyin interfaceIChemObject- 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- Parameters:
description- The object description of the property (most likely a unique string)- See Also:
-
getProperty
Returns a property for the IChemObject - the object is automatically cast to the required type. This does however mean if the wrong type is provided then a runtime ClassCastException will be thrown.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- Specified by:
getPropertyin interfaceIChemObject- 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 property is not set.
- See Also:
-
getProperty
Access a property of the given description and cast the specified class.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- Specified by:
getPropertyin interfaceIChemObject- Type Parameters:
T- generic type (of provided class)- Parameters:
description- description of a property (normally a string)c- type of the value to be returned- Returns:
- the value stored for the specified description.
- See Also:
-
getProperties
Returns a Map with the IChemObject's properties.- Specified by:
getPropertiesin interfaceIChemObject- Returns:
- The object's properties as an Map
- See Also:
-
getID
Returns the identifier (ID) of this object.- Specified by:
getIDin interfaceIChemObject- Returns:
- a String representing the ID value
- See Also:
-
setID
Sets the identifier (ID) of this object.- Specified by:
setIDin interfaceIChemObject- Parameters:
identifier- a String representing the ID value- See Also:
-
setFlag
public void setFlag(int mask, boolean value) 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- Parameters:
mask- flag to set the value forvalue- value to assign to flag- See Also:
-
getFlag
public boolean getFlag(int mask) 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- Parameters:
mask- flag to retrieve the value of- Returns:
- true if the flag
flag_typeis set - See Also:
-
setProperties
Set the properties of this object to the provided map (shallow copy). Any existing properties are removed.- Specified by:
setPropertiesin interfaceIChemObject- Parameters:
properties- map key-value pairs
-
addProperties
Add properties to this object, duplicate keys will replace any existing value.- Specified by:
addPropertiesin interfaceIChemObject- Parameters:
properties- a Map specifying the property values- See Also:
-
setFlags
public void setFlags(boolean[] newFlags) Sets the whole set of flags. This set will iteratively invokeIChemObject.setFlag(int, boolean)for each value in the array and useCDKConstants.FLAG_MASKSto look up the correct mask. If only a single flag is being set it is a lot faster to useIChemObject.setFlag(int, boolean).- Specified by:
setFlagsin interfaceIChemObject- Parameters:
newFlags- the new flags to set.- See Also:
-
getFlags
public boolean[] getFlags()Returns the whole set of flags. This method will create a new array on each invocation and it is recommend you useIChemObject.getFlagValue()if you need all the flags. For individual flags please useIChemObject.getFlag(int)- Specified by:
getFlagsin interfaceIChemObject- Returns:
- the flags.
- See Also:
-
getFlagValue
Access the internal value used to store the flags. The flags are stored on a single numeric value and are set/cleared.- Specified by:
getFlagValuein interfaceIChemObject- Returns:
- numeric representation of the flags
-
set
public void set(int flags) Description copied from interface:IChemObjectSet the provided flags. Any on-bits in the input parameter are set on in the ChemObject.- Specified by:
setin interfaceIChemObject- Parameters:
flags- the flags
-
clear
public void clear(int flags) Description copied from interface:IChemObjectClear the provided flags. Any on-bits in the input parameter are set on in the ChemObject.- Specified by:
clearin interfaceIChemObject- Parameters:
flags- the flags
-
is
public boolean is(int flags) Description copied from interface:IChemObjectTest if a flag(s) are set on this ChemObject. If multiple flags are provided they must all be set to return true.atom.set(IS_IN_RING); atom.is(IS_IN_RING); // false! atom.is(IS_IN_RING+IS_AROMATIC); // false! atom.set(IS_AROMATIC); atom.is(IS_IN_RING+IS_AROMATIC); // true!- Specified by:
isin interfaceIChemObject- Parameters:
flags- the flags
-
flags
public int flags()Description copied from interface:IChemObjectAccess the current value of the flags for this ChemObject.- Specified by:
flagsin interfaceIChemObject- Returns:
- the flag value (32-bit integer)
-