public class Bond extends ElectronContainer implements IBond, Serializable, Cloneable
IBond.Display, IBond.Order, IBond.Stereo
Modifier and Type | Field and Description |
---|---|
protected int |
atomCount
Number of atoms contained by this object.
|
protected IAtom[] |
atoms
A list of atoms participating in this bond.
|
protected IBond.Display |
display |
protected IBond.Order |
order
The bond order of this bond.
|
protected IBond.Stereo |
stereo
A descriptor the stereochemical orientation of this bond.
|
electronCount
Constructor and Description |
---|
Bond()
Constructs an empty bond.
|
Bond(IAtom[] atoms)
Constructs a multi-center bond, with undefined order and no stereo information.
|
Bond(IAtom[] atoms,
IBond.Order order)
Constructs a multi-center bond, with a specified order and no stereo information.
|
Bond(IAtom atom1,
IAtom atom2)
Constructs a bond with a single bond order..
|
Bond(IAtom atom1,
IAtom atom2,
IBond.Order order)
Constructs a bond with a given order.
|
Bond(IAtom beg,
IAtom end,
IBond.Order order,
IBond.Stereo stereo)
Constructs a bond with a given order and stereo orientation from an array
of atoms.
|
Modifier and Type | Method and Description |
---|---|
Iterable<IAtom> |
atoms()
Returns the Iterator to atoms making up this bond.
|
IBond |
clone()
Clones this bond object, including clones of the atoms between which the
bond is defined.
|
boolean |
compare(Object object)
Compares a bond with this bond.
|
boolean |
contains(IAtom atom)
Returns true if the given atom participates in this bond.
|
boolean |
equals(Object obj) |
javax.vecmath.Point2d |
get2DCenter()
Returns the geometric 2D center of the bond.
|
javax.vecmath.Point3d |
get3DCenter()
Returns the geometric 3D center of the bond.
|
IAtom |
getAtom(int position)
Returns an Atom from this bond.
|
int |
getAtomCount()
Returns the number of Atoms in this Bond.
|
IAtom |
getBegin()
Access the begin (or first) atom of the bond.
|
IAtom |
getConnectedAtom(IAtom atom)
Returns the other atom in the bond, the atom is connected to the given atom.
|
IAtom[] |
getConnectedAtoms(IAtom atom)
Returns all the atoms in the bond connected to the given atom.
|
IAtomContainer |
getContainer() |
IBond.Display |
getDisplay()
Access the bond display style.
|
IAtom |
getEnd()
Access the end (or second) atom of the bond.
|
int |
getIndex() |
IBond.Order |
getOrder()
Returns the bond order of this bond.
|
IAtom |
getOther(IAtom atom)
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 correct
IBond.getConnectedAtoms(IAtom) should be used. |
IBond.Stereo |
getStereo()
Returns the stereo descriptor for this bond.
|
int |
hashCode() |
boolean |
isAromatic()
Access whether this bond has been marked as aromatic.
|
boolean |
isConnectedTo(IBond bond)
Checks whether a bond is connected to another one.
|
boolean |
isInRing()
Access whether this bond has been flagged as in a ring.
|
void |
setAtom(IAtom atom,
int position)
Sets an Atom in this bond.
|
void |
setAtoms(IAtom[] atoms)
Sets the array of atoms making up this bond.
|
void |
setDisplay(IBond.Display display)
Set the bond display style.
|
void |
setIsAromatic(boolean arom)
Mark this bond as being aromatic.
|
void |
setIsInRing(boolean ring)
Mark this bond as being in a ring.
|
void |
setOrder(IBond.Order order)
Sets the bond order of this bond.
|
void |
setStereo(IBond.Stereo stereo)
Sets the stereo descriptor for this bond.
|
String |
toString()
Returns a one line string representation of this Container.
|
getElectronCount, setElectronCount
addListener, addProperties, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy
finalize, getClass, notify, notifyAll, wait, wait, wait
getElectronCount, setElectronCount
addListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
getBuilder
protected IBond.Order order
protected int atomCount
protected IAtom[] atoms
protected IBond.Stereo stereo
protected IBond.Display display
public Bond()
public Bond(IAtom atom1, IAtom atom2)
atom1
- the first Atom in the bondatom2
- the second Atom in the bondpublic Bond(IAtom atom1, IAtom atom2, IBond.Order order)
atom1
- the first Atom in the bondatom2
- the second Atom in the bondorder
- the bond orderpublic Bond(IAtom[] atoms)
atoms
- An array of IAtom containing the atoms constituting the bondpublic Bond(IAtom[] atoms, IBond.Order order)
atoms
- An array of IAtom containing the atoms constituting the bondorder
- The order of the bondpublic Bond(IAtom beg, IAtom end, IBond.Order order, IBond.Stereo stereo)
beg
- the first Atom in the bondend
- the second Atom in the bondorder
- the bond orderstereo
- a descriptor the stereochemical orientation of this bondpublic Iterable<IAtom> atoms()
atoms
in interface IBond
setAtoms(org.openscience.cdk.interfaces.IAtom[])
public IAtomContainer getContainer()
getContainer
in interface IBond
public void setAtoms(IAtom[] atoms)
public int getAtomCount()
getAtomCount
in interface IBond
public IAtom getAtom(int position)
getAtom
in interface IBond
position
- The position in this bond where the atom issetAtom(org.openscience.cdk.interfaces.IAtom, int)
public IAtom getBegin()
public IAtom getEnd()
public IAtom getOther(IAtom atom)
IBond.getConnectedAtoms(IAtom)
should be used.
IAtom beg = bond.getBegin();
IAtom end = bond.getEnd();
// bond.getOther(beg) == end
// bond.getOther(end) == beg
public IAtom getConnectedAtom(IAtom atom)
IBond.getConnectedAtoms(IAtom)
should be used.
IAtom beg = bond.getBegin();
IAtom end = bond.getEnd();
// bond.getConnectedAtom(beg) == end
// bond.getConnectedAtom(end) == beg
getConnectedAtom
in interface IBond
atom
- The atom the bond partner is searched ofpublic IAtom[] getConnectedAtoms(IAtom atom)
getConnectedAtoms
in interface IBond
atom
- The atoms the bond partner is searched ofpublic boolean contains(IAtom atom)
public void setAtom(IAtom atom, int position)
setAtom
in interface IBond
atom
- The atom to be setposition
- The position in this bond where the atom is to be insertedgetAtom(int)
public IBond.Order getOrder()
getOrder
in interface IBond
org.openscience.cdk.CDKConstants
for predefined values.
,
setOrder(org.openscience.cdk.interfaces.IBond.Order)
public void setOrder(IBond.Order order)
setOrder
in interface IBond
order
- The bond order to be assigned to this bondorg.openscience.cdk.CDKConstants for predefined values.
,
getOrder()
public IBond.Stereo getStereo()
getStereo
in interface IBond
setStereo(org.openscience.cdk.interfaces.IBond.Stereo)
,
for predefined values.
public void setStereo(IBond.Stereo stereo)
setStereo
in interface IBond
stereo
- The stereo descriptor to be assigned to this bond.getStereo()
,
for predefined values.
public IBond.Display getDisplay()
getDisplay
in interface IBond
public void setDisplay(IBond.Display display)
setDisplay
in interface IBond
display
- the displaypublic javax.vecmath.Point2d get2DCenter()
get2DCenter
in interface IBond
public javax.vecmath.Point3d get3DCenter()
get3DCenter
in interface IBond
public boolean compare(Object object)
compare
in interface IBond
compare
in class ChemObject
object
- Object of type Bondpublic boolean isConnectedTo(IBond bond)
isConnectedTo
in interface IBond
bond
- The bond which is checked to be connect with this onepublic boolean isAromatic()
isAromatic
in interface IBond
IChemObject.getFlag(int)
,
Aromaticity
public void setIsAromatic(boolean arom)
setIsAromatic
in interface IBond
arom
- aromatic statusIChemObject.setFlag(int, boolean)
public boolean isInRing()
isInRing
in interface IBond
IChemObject.getFlag(int)
,
RingSearch
public void setIsInRing(boolean ring)
setIsInRing
in interface IBond
ring
- ring statusIChemObject.setFlag(int, boolean)
public IBond clone() throws CloneNotSupportedException
clone
in interface IBond
clone
in interface IChemObject
clone
in class ElectronContainer
CloneNotSupportedException
- if the IChemObject cannot be clonedpublic String toString()
toString
in interface IChemObject
toString
in class ElectronContainer
Copyright © 2021. All rights reserved.