Class QueryAtom
- All Implemented Interfaces:
Cloneable,IAtom,IAtomType,ICDKObject,IChemObject,IElement,IIsotope,IQueryAtom
- Direct Known Subclasses:
InverseSymbolSetQueryAtom,SMARTSAtom,SymbolAndChargeQueryAtom,SymbolChargeIDQueryAtom,SymbolQueryAtom,SymbolSetQueryAtom
- Source code:
- main
- Belongs to CDK module:
- isomorphism
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openscience.cdk.interfaces.IAtomType
IAtomType.Hybridization -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IntegerThe atomic number for this element giving their position in the periodic table.protected DoubleThe partial charge of the atom.protected IntegerThe electron Valency of this atom with CDKConstants.UNSET as default.Exact mass of this isotope.protected IntegerThe formal charge of the atom with CDKConstants.UNSET as default.protected IntegerThe formal number of neighbours this atom type can have with CDKConstants_UNSET as default.protected javax.vecmath.Point3dA 3 point specifying the location of this atom in a crystal unit cell.protected IAtomType.HybridizationThe hybridization state of this atom with CDKConstants.HYBRIDIZATION_UNSET as default.protected IntegerThe number of implicitly bound hydrogen atoms for this atom.Natural abundance of this isotope.protected javax.vecmath.Point2dA 2D point specifying the location of this atom in a 2D coordinate space.protected javax.vecmath.Point3dA 3 point specifying the location of this atom in a 3D coordinate space.protected IntegerA stereo parity descriptor for the stereochemistry of this atom.protected StringThe element symbol for this element as listed in the periodic table.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 -
Constructor Summary
ConstructorsConstructorDescriptionQueryAtom(String symbol, IChemObjectBuilder builder) QueryAtom(IChemObjectBuilder builder) Create a new query atom with the given an expression.Create a new query atom with the given an predicate expression type.Create a new query atom with the given an value expression type. -
Method Summary
Modifier and TypeMethodDescriptionbonds()Returns the bonds connected to this atom.clone()Returns a deep clone of this IChemObject.booleanReturns 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 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.Get the atom-expression predicate for this query atom.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.Returns the hydrogen count of this atom.intgetIndex()Acces the index of an atom in the context of anIAtomContainer.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.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 the stereo parity of this atom.Returns the element symbol of this element.Gets the the exact electron valency of the AtomType object.inthashCode()booleanAccess whether this atom has been marked as aromatic.booleanisInRing()Access whether this atom has been flagged as in a ring.booleanReturns true of the givenatommatches this IQueryAtom.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.voidsetExpression(Expr expr) Set the atom-expression predicate for this query atom.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.voidsetImplicitHydrogenCount(Integer hydrogenCount) Sets the number of 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.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.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.isomorphism.matchers.QueryChemObject
addListener, addProperties, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setPropertyMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilderMethods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, toString
-
Field Details
-
charge
The partial charge of the atom.The default value is
CDKConstants.UNSETand serves to provide a check whether the charge has been set or not -
point2d
protected javax.vecmath.Point2d point2dA 2D point specifying the location of this atom in a 2D coordinate space. -
point3d
protected javax.vecmath.Point3d point3dA 3 point specifying the location of this atom in a 3D coordinate space. -
fractionalPoint3d
protected javax.vecmath.Point3d fractionalPoint3dA 3 point specifying the location of this atom in a crystal unit cell. -
hydrogenCount
The number of implicitly bound hydrogen atoms for this atom. -
stereoParity
A stereo parity descriptor for the stereochemistry of this atom. -
formalCharge
The formal charge of the atom with CDKConstants.UNSET as default. Implements RFC #6.Note that some constructors e.g. (
AtomType(String)andAtomType(String, String)) will explicitly set this field to 0 -
hybridization
The hybridization state of this atom with CDKConstants.HYBRIDIZATION_UNSET as default. -
electronValency
The electron Valency of this atom with CDKConstants.UNSET as default. -
formalNeighbourCount
The formal number of neighbours this atom type can have with CDKConstants_UNSET as default. This includes explicitely and implicitely connected atoms, including implicit hydrogens. -
exactMass
Exact mass of this isotope. -
naturalAbundance
Natural abundance of this isotope. -
symbol
The element symbol for this element as listed in the periodic table. -
atomicNumber
The atomic number for this element giving their position in the periodic table.
-
-
Constructor Details
-
QueryAtom
-
QueryAtom
-
QueryAtom
Create a new query atom with the given an expression.// oxygen in a ring Expr expr = new Expr(IS_IN_RING); expr.and(new Expr(ELEMENT, 8)); new QueryAtom(expr);- Parameters:
expr- the expr
-
QueryAtom
Create a new query atom with the given an predicate expression type.new QueryAtom(IS_IN_RING);- Parameters:
type- the expr type
-
QueryAtom
Create a new query atom with the given an value expression type.// oxygen new QueryAtom(ELEMENT, 8);- Parameters:
type- the expr typeval- the expr value
-
-
Method Details
-
getIndex
public int getIndex()Acces the index of an atom in the context of anIAtomContainer. If the index is not known, < 0 is returned. -
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
-
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()) { } -
getBondCount
public int getBondCount()Get 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. -
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- 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- 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- 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- 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- 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- 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- 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- 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- 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- Returns:
- The stereo parity for this atom
- 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:
-
setMaxBondOrder
Sets the MaxBondOrder attribute of the AtomType object.- Specified by:
setMaxBondOrderin interfaceIAtomType- 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- Parameters:
bondOrderSum- The new bondOrderSum value- See Also:
-
getAtomTypeName
Gets the id attribute of the AtomType object.- Specified by:
getAtomTypeNamein interfaceIAtomType- Returns:
- The id value
- See Also:
-
getMaxBondOrder
Gets the MaxBondOrder attribute of the AtomType object.- Specified by:
getMaxBondOrderin interfaceIAtomType- Returns:
- The MaxBondOrder value
- See Also:
-
getBondOrderSum
Gets the bondOrderSum attribute of the AtomType object.- Specified by:
getBondOrderSumin interfaceIAtomType- Returns:
- The bondOrderSum value
- See Also:
-
setFormalCharge
Sets the formal charge of this atom.- Specified by:
setFormalChargein interfaceIAtomType- Parameters:
charge- The formal charge- See Also:
-
getFormalCharge
Returns the formal charge of this atom.- Specified by:
getFormalChargein interfaceIAtomType- Returns:
- the formal charge 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:
-
getFormalNeighbourCount
Returns the formal neighbour count of this atom.- Specified by:
getFormalNeighbourCountin interfaceIAtomType- Returns:
- the formal neighbour count of this atom
- See Also:
-
setHybridization
Sets the hybridization of this atom.- Specified by:
setHybridizationin interfaceIAtomType- Parameters:
hybridization- The hybridization- See Also:
-
getHybridization
Returns the hybridization of this atom.- Specified by:
getHybridizationin interfaceIAtomType- Returns:
- the hybridization of this atom
- See Also:
-
setNaturalAbundance
Sets the NaturalAbundance attribute of the Isotope object.- Specified by:
setNaturalAbundancein interfaceIIsotope- Parameters:
naturalAbundance- The new NaturalAbundance value- See Also:
-
setExactMass
Sets the ExactMass attribute of the Isotope object.- Specified by:
setExactMassin interfaceIIsotope- 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- 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- 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- 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:
-
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:
-
getSymbol
Returns the element symbol of this element. -
setSymbol
Sets the element symbol of this element. -
setCovalentRadius
Sets the covalent radius for this AtomType.- Specified by:
setCovalentRadiusin interfaceIAtomType- Parameters:
radius- The covalent radius for this AtomType- See Also:
-
getCovalentRadius
Returns the covalent radius for this AtomType.- Specified by:
getCovalentRadiusin interfaceIAtomType- Returns:
- The covalent radius for this AtomType
- 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:
-
getValency
Gets the the exact electron valency of the AtomType object.- Specified by:
getValencyin interfaceIAtomType- Returns:
- The valency value
- See Also:
-
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()Access the map index for this atom. -
setMapIdx
public void setMapIdx(int mapidx) Set the map index for this atom. -
setExpression
Set the atom-expression predicate for this query atom.- Parameters:
expr- the expression
-
getExpression
Get the atom-expression predicate for this query atom.- Returns:
- the expression
-
matches
Returns true of the givenatommatches this IQueryAtom.- Specified by:
matchesin interfaceIQueryAtom- Overrides:
matchesin classQueryChemObject- Parameters:
atom- IAtom to match against- Returns:
- true, if this IQueryAtom matches the given IAtom
-
clone
Description copied from interface:IChemObjectReturns a deep clone of this IChemObject.- Specified by:
clonein interfaceIAtom- Specified by:
clonein interfaceIChemObject- Overrides:
clonein classQueryChemObject- Returns:
- Object the clone of this IChemObject.
- Throws:
CloneNotSupportedException- if the IChemObject cannot be cloned
-
hashCode
public int hashCode() -
equals
-