Package org.openscience.cdk.interfaces
Interface IBond
- All Superinterfaces:
Cloneable,ICDKObject,IChemObject,IElectronContainer
- All Known Subinterfaces:
IQueryBond
- All Known Implementing Classes:
AnyOrderQueryBond,AromaticOrSingleQueryBond,AromaticQueryBond,Bond,Bond,BondRef,CTFileQueryBond,DebugBond,LogicalOperatorBond,OrderQueryBond,OrderQueryBond,OrderQueryBondOrderOnly,PharmacophoreAngleBond,PharmacophoreBond,PharmacophoreQueryAngleBond,PharmacophoreQueryBond,QueryBond,RingBond,SMARTSBond,StereoBond
Implements the concept of a covalent bond between two or more atoms. A bond is
considered to be a number of electrons connecting two ore more atoms.
type filter text
- Author:
- egonw
- Keywords:
- bond, atom, electron
- Created on:
- 2005-08-24
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumBond display style, controlling how bonds appear in a 2D depiction.static enumA list of permissible bond orders.static enumDeprecated. -
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, VISITED -
Method Summary
Modifier and TypeMethodDescriptionatoms()Returns the Iterable to atoms making up this bond.clone()Returns a deep clone of this IChemObject.booleanCompares a bond with this bond.default booleanReturns true if the given atom participates in this bond.javax.vecmath.Point2dReturns the geometric 2D center of the bond.javax.vecmath.Point3dReturns the geometric 3D center of the bond.getAtom(int position) Returns an Atom from this bond.intReturns the number of Atoms in this Bond.getBegin()Access the begin (or first) atom of the bond.getConnectedAtom(IAtom atom) Deprecated.default IAtomgetConnectedAtom(IBond other) Get the connected atom between two bonds.IAtom[]getConnectedAtoms(IAtom atom) Returns all the atoms in the bond connected to the given atom.Access the bond display style.getEnd()Access the end (or second) atom of the bond.intgetIndex()getOrder()Returns the bond order of this bond.Returns the other atom in the bond, the atom is connected to the given atom.This method is only correct for two-centre bonds, for n-centre bonds the behaviour is undefined and the more correctgetConnectedAtoms(IAtom)should be used.Deprecated.usegetDisplay()booleanAccess whether this bond has been marked as aromatic.booleanisConnectedTo(IBond bond) Checks whether a bond is connected to another one.booleanisInRing()Access whether this bond has been flagged as in a ring.voidSets an Atom in this bond.voidSets the array of atoms making up this bond.voidsetDisplay(IBond.Display display) Set the bond display style.voidsetIsAromatic(boolean arom) Mark this bond as being aromatic.voidsetIsInRing(boolean ring) Mark this bond as being in a ring.voidsetOrder(IBond.Order order) Sets the bond order of this bond.voidsetStereo(IBond.Stereo stereo) Deprecated.Methods 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, toStringMethods inherited from interface org.openscience.cdk.interfaces.IElectronContainer
getElectronCount, setElectronCount
-
Method Details
-
atoms
Returns the Iterable to atoms making up this bond.- Returns:
- An Iterable to atoms participating in this bond
- See Also:
-
setAtoms
Sets the array of atoms making up this bond.- Parameters:
atoms- An array of atoms that forms this bond- See Also:
-
getBegin
IAtom getBegin()Access the begin (or first) atom of the bond.- Returns:
- the begin atom
-
getEnd
IAtom getEnd()Access the end (or second) atom of the bond.- Returns:
- the end atom
-
getIndex
int getIndex() -
getContainer
IAtomContainer getContainer() -
getAtomCount
int getAtomCount()Returns the number of Atoms in this Bond.- Returns:
- The number of Atoms in this Bond
-
getAtom
Returns an Atom from this bond.- Parameters:
position- The position in this bond where the atom is- Returns:
- The atom at the specified position
- See Also:
-
getConnectedAtom
Deprecated.use the methodgetOther(IAtom)Returns the other atom in the bond, the atom is connected to the given atom. This method is only correct for two-centre bonds, for n-centre bonds the behaviour is undefined and the more correctgetConnectedAtoms(IAtom)should be used.IAtom beg = bond.getBegin(); IAtom end = bond.getEnd(); // bond.getConnectedAtom(beg) == end // bond.getConnectedAtom(end) == beg- Parameters:
atom- The atom the bond partner is searched of- Returns:
- the connected atom or null if the given atom is not part of the bond
-
getOther
Returns the other atom in the bond, the atom is connected to the given atom.This method is only correct for two-centre bonds, for n-centre bonds the behaviour is undefined and the more correctgetConnectedAtoms(IAtom)should be used.IAtom beg = bond.getBegin(); IAtom end = bond.getEnd(); // bond.getOther(beg) == end // bond.getOther(end) == beg- Parameters:
atom- The atom the bond partner is searched of- Returns:
- the connected atom or null if the given atom is not part of the bond
-
getConnectedAtoms
Returns all the atoms in the bond connected to the given atom.- Parameters:
atom- The atoms the bond partner is searched of- Returns:
- the connected atoms or null if the given atom is not part of the bond
-
contains
Returns true if the given atom participates in this bond.- Parameters:
atom- The atom to be tested if it participates in this bond- Returns:
- true if the atom participates in this bond
-
getConnectedAtom
Get the connected atom between two bonds.- Parameters:
other- the other bond (not nullable)- Returns:
- the common atom or null if none in common
-
setAtom
Sets an Atom in this bond.- Parameters:
atom- The atom to be setposition- The position in this bond where the atom is to be inserted- See Also:
-
getOrder
IBond.Order getOrder()Returns the bond order of this bond.- Returns:
- The bond order of this bond
- See Also:
-
setOrder
Sets the bond order of this bond.- Parameters:
order- The bond order to be assigned to this bond- See Also:
-
getStereo
IBond.Stereo getStereo()Deprecated.usegetDisplay()Returns the stereo descriptor for this bond.- Returns:
- The stereo descriptor for this bond
- See Also:
-
setStereo
Deprecated.Sets the stereo descriptor for this bond. Note this function will also modify the bond display style.- Parameters:
stereo- The stereo descriptor to be assigned to this bond.- See Also:
-
getDisplay
IBond.Display getDisplay()Access the bond display style.- Returns:
- the bond display
-
setDisplay
Set the bond display style.- Parameters:
display- the display
-
get2DCenter
javax.vecmath.Point2d get2DCenter()Returns the geometric 2D center of the bond.- Returns:
- The geometric 2D center of the bond
-
get3DCenter
javax.vecmath.Point3d get3DCenter()Returns the geometric 3D center of the bond.- Returns:
- The geometric 3D center of the bond
-
compare
Compares a bond with this bond.- Parameters:
object- Object of type Bond- Returns:
- Return true, if the bond is equal to this bond
-
isConnectedTo
Checks whether a bond is connected to another one. This can only be true if the bonds have an Atom in common.- Parameters:
bond- The bond which is checked to be connect with this one- Returns:
- True, if the bonds share an atom, otherwise false
-
isAromatic
boolean isAromatic()Access whether this bond has been marked as aromatic. The default value is false and you must explicitly perceive aromaticity with one of the available models.- Returns:
- aromatic status
- See Also:
-
setIsAromatic
void setIsAromatic(boolean arom) Mark this bond as being aromatic.- Parameters:
arom- aromatic status- See Also:
-
isInRing
boolean isInRing()Access whether this bond has been flagged as in a ring. The default value is false and you must explicitly find rings first.- Returns:
- ring status
- See Also:
-
setIsInRing
void setIsInRing(boolean ring) Mark this bond as being in a ring.- Parameters:
ring- ring status- See Also:
-
clone
Returns a deep clone of this IChemObject.- Specified by:
clonein interfaceIChemObject- Returns:
- Object the clone of this IChemObject.
- Throws:
CloneNotSupportedException- if the IChemObject cannot be cloned
-
getOther(IAtom)