Chemical Data Processing Library Python API - Version 1.2.0
|
A common interface for data-structures that support a random access to stored Chem.Bond instances. More...
Public Member Functions | |
None | __init__ () |
Initializes the BondContainer instance. | |
Bond | getBond (int idx) |
Returns a reference to the bond at index idx. More... | |
bool | containsBond (Bond bond) |
Tells whether the specified Chem.Bond instance is stored in this container. More... | |
None | orderBonds (BoolBond2Functor func) |
Orders the stored bonds according to criteria implemented by the provided bond comparison function. More... | |
int | getBondIndex (Bond bond) |
Returns the index of the specified Chem.Bond instance in this container. More... | |
int | getNumBonds () |
Returns the number of stored Chem.Bond objects. More... | |
int | getObjectID () |
Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
bool | __contains__ (Bond bond) |
Returns the result of the membership test operation bond in self . More... | |
Bond | __getitem__ (int idx) |
int | __len__ () |
Properties | |
objectID = property(getObjectID) | |
numBonds = property(getNumBonds) | |
A common interface for data-structures that support a random access to stored Chem.Bond instances.
Implementations have to guarantee that a given Chem.Bond object is stored only once and its index is unique amongst all contained Chem.Bond instances. Otherwise algorithms that rely on this behaviour may not work correctly!
Bond CDPL.Chem.BondContainer.getBond | ( | int | idx | ) |
Returns a reference to the bond at index idx.
idx | The zero-based index of the Chem.Bond instance to return. |
Base.IndexError | if the number of bonds is zero or idx is not in the range [0, getNumBonds() - 1]. |
Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, and CDPL.Chem.Atom.
bool CDPL.Chem.BondContainer.containsBond | ( | Bond | bond | ) |
Tells whether the specified Chem.Bond instance is stored in this container.
bond | The Chem.Bond instance to look for. |
True
if bond is stored in the container, and False
otherwise. Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, and CDPL.Chem.Atom.
None CDPL.Chem.BondContainer.orderBonds | ( | BoolBond2Functor | func | ) |
Orders the stored bonds according to criteria implemented by the provided bond comparison function.
func | The bond comparison function implementing the applied ordering criteria. |
Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, and CDPL.Chem.Atom.
int CDPL.Chem.BondContainer.getBondIndex | ( | Bond | bond | ) |
Returns the index of the specified Chem.Bond instance in this container.
bond | The Chem.Bond instance for which to return the index. |
Base.ItemNotFound | if the specified Chem.Bond instance could not be found. |
Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, and CDPL.Chem.Atom.
int CDPL.Chem.BondContainer.getNumBonds | ( | ) |
Returns the number of stored Chem.Bond objects.
Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, and CDPL.Chem.Atom.
int CDPL.Chem.BondContainer.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python BondContainer instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b
thus cannot tell reliably whether the two BondContainer instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID()
.
Reimplemented in CDPL.ConfGen.CanonicalFragment.
bool CDPL.Chem.BondContainer.__contains__ | ( | Bond | bond | ) |
Returns the result of the membership test operation bond in self
.
bond | The value to test for membership. |
Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Fragment, and CDPL.Chem.Atom.
Bond CDPL.Chem.BondContainer.__getitem__ | ( | int | idx | ) |
idx |
Reimplemented in CDPL.Biomol.HierarchyViewModel, and CDPL.Biomol.HierarchyViewChain.
int CDPL.Chem.BondContainer.__len__ | ( | ) |
Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Fragment, CDPL.Chem.Atom, CDPL.Biomol.HierarchyViewModel, and CDPL.Biomol.HierarchyViewChain.