![]() |
Chemical Data Processing Library Python API - Version 1.4.0
|
Data structure storing a set of Chem.MatchConstraint objects together with a logical type. More...
Inheritance diagram for CDPL.Chem.MatchConstraintList:Classes | |
| class | Type |
| Defines constants that describe the logical type of the match constraint list. More... | |
Public Member Functions | |
| None | __init__ (MatchConstraintList list) |
Contructs a copy of the MatchConstraintList instance list. More... | |
| None | __init__ (Type type=CDPL.Chem.Type.AND_LIST) |
Constructs the MatchConstraintList instance with the specified logical type. More... | |
| int | getObjectID () |
| Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
| int | getSize () |
| Returns the number of elements stored in the list. More... | |
| bool | isEmpty () |
Tells whether the list is empty (getSize() == 0). More... | |
| None | resize (int num_elem, MatchConstraint value) |
| Inserts or erases elements at the end so that the size becomes num_elem. More... | |
| None | reserve (int num_elem) |
| Preallocates memory for (at least) num_elem elements. More... | |
| int | getCapacity () |
| Returns the number of elements for which memory has been allocated. More... | |
| None | clear () |
| Erases all elements. | |
| MatchConstraintList | assign (MatchConstraintList list) |
Replaces the current state with a copy of the state of the MatchConstraintList instance list. More... | |
| None | assign (int num_elem, MatchConstraint value) |
| This function fills the array with num_elem copies of the given value. More... | |
| None | addElement (MatchConstraint value) |
| Adds a new element at the end of the list. More... | |
| None | addElement (int id, Relation rel) |
| Appends a new Chem.MatchConstraint element with the given identifier and relational constraint on the values of matching query/target attribute pairs. More... | |
| None | addElement (int id, Relation rel, Base.Any val) |
| Appends a new Chem.MatchConstraint element with the given identifier, relational constraint on the values of matching query/target attribute pairs and value of the query attribute. More... | |
| None | addElements (MatchConstraintList values) |
| Adds the elements of values to the end of the list. More... | |
| None | insertElement (int idx, MatchConstraint value) |
| Inserts a new element before the location specified by the index idx. More... | |
| None | insertElements (int idx, int num_elem, MatchConstraint value) |
| Inserts num_elem copies of value before the location specified by the index idx. More... | |
| None | insertElements (int idx, MatchConstraintList values) |
| Insert the elements of values before the location specified by the index idx. More... | |
| None | popLastElement () |
| Removes the last element of the list. More... | |
| None | removeElement (int idx) |
| Removes the element at index idx. More... | |
| None | removeElements (int begin_idx, int end_idx) |
| Removes the elements at indices in the range [begin_idx, end_idx). More... | |
| MatchConstraint | getFirstElement () |
| Returns the first element of the list. More... | |
| MatchConstraint | getLastElement () |
| Returns the last element of the list. More... | |
| MatchConstraint | getElement (int idx) |
| Returns the element at index idx. More... | |
| None | setElement (int idx, MatchConstraint value) |
| Assigns a new value to the element at index idx. More... | |
| Type | getType () |
| Returns the logical type of the match constraint list. More... | |
| None | setType (Type type) |
| Sets the logical type of the match constraint list. More... | |
| None | __delitem__ (int idx) |
| Removes the element at index idx. More... | |
| MatchConstraint | __getitem__ (int idx) |
| Returns the element at index idx. More... | |
| int | __len__ () |
| Returns the number of elements stored in the list. More... | |
| None | __setitem__ (int idx, MatchConstraint value) |
| Assigns a new value to the element at index idx. More... | |
| str | __str__ () |
Returns a string representation of the MatchConstraintList instance. More... | |
Properties | |
| objectID = property(getObjectID) | |
| size = property(getSize) | |
| type = property(getType, setType) | |
Data structure storing a set of Chem.MatchConstraint objects together with a logical type.
Match constraint lists are usually stored as object properties (e.g. Chem.AtomProperty.MATCH_CONSTRAINTS) and evaluated by code building corresponding Chem.MatchExpression implementation instances for substructure searching purposes.
| None CDPL.Chem.MatchConstraintList.__init__ | ( | MatchConstraintList | list | ) |
Contructs a copy of the MatchConstraintList instance list.
| list | The MatchConstraintList instance to copy. |
| None CDPL.Chem.MatchConstraintList.__init__ | ( | Type | type = CDPL.Chem.Type.AND_LIST | ) |
Constructs the MatchConstraintList instance with the specified logical type.
| type | The logical type of the match constraint list. |
| int CDPL.Chem.MatchConstraintList.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python MatchConstraintList 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 MatchConstraintList 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().
| int CDPL.Chem.MatchConstraintList.getSize | ( | ) |
Returns the number of elements stored in the list.
| bool CDPL.Chem.MatchConstraintList.isEmpty | ( | ) |
Tells whether the list is empty (getSize() == 0).
True if the list is empty, False otherwise. | None CDPL.Chem.MatchConstraintList.resize | ( | int | num_elem, |
| MatchConstraint | value | ||
| ) |
Inserts or erases elements at the end so that the size becomes num_elem.
| num_elem | The new size. |
| value | The value for newly inserted elements. |
| None CDPL.Chem.MatchConstraintList.reserve | ( | int | num_elem | ) |
Preallocates memory for (at least) num_elem elements.
If num_elem is less than or equal to the current capacity, this call has no effect. Otherwise, it is a request for allocation of additional memory. If the request is successful, then the capacity is greater than or equal to num_elem. Otherwise, the capacity is unchanged. In either case, the number of elements will not change.
| num_elem | The number of elements to reserve memory for. |
| int CDPL.Chem.MatchConstraintList.getCapacity | ( | ) |
Returns the number of elements for which memory has been allocated.
The capacity is always greater than or equal to the number of currently stored elements.
| MatchConstraintList CDPL.Chem.MatchConstraintList.assign | ( | MatchConstraintList | list | ) |
Replaces the current state with a copy of the state of the MatchConstraintList instance list.
| list | The MatchConstraintList instance to copy. |
| None CDPL.Chem.MatchConstraintList.assign | ( | int | num_elem, |
| MatchConstraint | value | ||
| ) |
This function fills the array with num_elem copies of the given value.
Note that the assignment completely changes the array and the new size is the same as the number of elements assigned. Old data will be lost.
| num_elem | The number of elements to be assigned. |
| value | The value to be assigned. |
| None CDPL.Chem.MatchConstraintList.addElement | ( | MatchConstraint | value | ) |
Adds a new element at the end of the list.
| value | The value of the new element. |
| None CDPL.Chem.MatchConstraintList.addElement | ( | int | id, |
| Relation | rel | ||
| ) |
Appends a new Chem.MatchConstraint element with the given identifier and relational constraint on the values of matching query/target attribute pairs.
| id | The identifier of the match constraint. |
| rel | The relational constraint on the values of matching query/target attribute pairs. |
| None CDPL.Chem.MatchConstraintList.addElement | ( | int | id, |
| Relation | rel, | ||
| Base.Any | val | ||
| ) |
Appends a new Chem.MatchConstraint element with the given identifier, relational constraint on the values of matching query/target attribute pairs and value of the query attribute.
| id | The identifier of the match constraint. |
| rel | The relational constraint on the values of matching query/target attribute pairs. |
| val | The value of the query attribute. |
| None CDPL.Chem.MatchConstraintList.addElements | ( | MatchConstraintList | values | ) |
Adds the elements of values to the end of the list.
| values | The MatchConstraintList instance providing the elements to add. |
| None CDPL.Chem.MatchConstraintList.insertElement | ( | int | idx, |
| MatchConstraint | value | ||
| ) |
Inserts a new element before the location specified by the index idx.
| idx | The location where to insert the new element. |
| value | The value of the element to insert. |
| Base.IndexError | if idx is not in the range [0, getSize()]. |
| None CDPL.Chem.MatchConstraintList.insertElements | ( | int | idx, |
| int | num_elem, | ||
| MatchConstraint | value | ||
| ) |
Inserts num_elem copies of value before the location specified by the index idx.
| idx | The location where to insert the new elements. |
| num_elem | The number of elements to insert. |
| value | The value of the elements to insert. |
| Base.IndexError | if idx is not in the range [0, getSize()]. |
| None CDPL.Chem.MatchConstraintList.insertElements | ( | int | idx, |
| MatchConstraintList | values | ||
| ) |
Insert the elements of values before the location specified by the index idx.
| idx | The zero-based insertion index. |
| values | The MatchConstraintList instance providing the elements to insert. |
| Base.IndexError | if idx is not in the range [0, getSize()]. |
| None CDPL.Chem.MatchConstraintList.popLastElement | ( | ) |
Removes the last element of the list.
| Base.OperationFailed | if the list is empty. |
| None CDPL.Chem.MatchConstraintList.removeElement | ( | int | idx | ) |
Removes the element at index idx.
| idx | The zero-based index of the element to remove. |
| Base.IndexError | if idx is not in the range [0, getSize()). |
| None CDPL.Chem.MatchConstraintList.removeElements | ( | int | begin_idx, |
| int | end_idx | ||
| ) |
Removes the elements at indices in the range [begin_idx, end_idx).
| begin_idx | The zero-based index range start. |
| end_idx | The zero-based index range end. |
| Base.IndexError | if begin_idx or end_idx is not in the range [0, getSize()] or end_idx < begin_idx. |
| MatchConstraint CDPL.Chem.MatchConstraintList.getFirstElement | ( | ) |
Returns the first element of the list.
| Base.OperationFailed | if the list is empty. |
| MatchConstraint CDPL.Chem.MatchConstraintList.getLastElement | ( | ) |
Returns the last element of the list.
| Base.OperationFailed | if the list is empty. |
| MatchConstraint CDPL.Chem.MatchConstraintList.getElement | ( | int | idx | ) |
Returns the element at index idx.
The method is equivalent to __getitem__().
| idx | The zero-based index of the element. |
| Base.IndexError | if idx is not in the range [0, getSize()). |
| None CDPL.Chem.MatchConstraintList.setElement | ( | int | idx, |
| MatchConstraint | value | ||
| ) |
Assigns a new value to the element at index idx.
| idx | The zero-based index of the element. |
| value | The new value of the element after assignment. |
| Base.IndexError | if idx is not in the range [0, getSize()). |
| Type CDPL.Chem.MatchConstraintList.getType | ( | ) |
Returns the logical type of the match constraint list.
| None CDPL.Chem.MatchConstraintList.setType | ( | Type | type | ) |
Sets the logical type of the match constraint list.
| type | The logical type of the match constraint list. |
| None CDPL.Chem.MatchConstraintList.__delitem__ | ( | int | idx | ) |
Removes the element at index idx.
| idx | The zero-based index of the element to remove. |
| Base.IndexError | if idx is not in the range [0, getSize()). |
| MatchConstraint CDPL.Chem.MatchConstraintList.__getitem__ | ( | int | idx | ) |
Returns the element at index idx.
| idx | The zero-based index of the element. |
| Base.IndexError | if idx is not in the range [0, getSize()). |
| int CDPL.Chem.MatchConstraintList.__len__ | ( | ) |
Returns the number of elements stored in the list.
| None CDPL.Chem.MatchConstraintList.__setitem__ | ( | int | idx, |
| MatchConstraint | value | ||
| ) |
Assigns a new value to the element at index idx.
| idx | The zero-based index of the element. |
| value | The new value of the element after assignment. |
| Base.IndexError | if idx is not in the range [0, getSize()). |
| str CDPL.Chem.MatchConstraintList.__str__ | ( | ) |
Returns a string representation of the MatchConstraintList instance.