Chemical Data Processing Library Python API - Version 1.4.0
Classes | Public Member Functions | Properties | List of all members
CDPL.Chem.MatchConstraintList Class Reference

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)
 Initializes 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 ()
 
bool isEmpty ()
 
None resize (int num_elem, MatchConstraint value)
 
None reserve (int num_elem)
 
int getCapacity ()
 
None clear ()
 
MatchConstraintList assign (MatchConstraintList array)
 Replaces the current state of self with a copy of the state of the MatchConstraintList instance array. More...
 
None assign (int num_elem, MatchConstraint value)
 
None addElement (MatchConstraint value)
 
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)
 
None insertElement (int idx, MatchConstraint value)
 
None insertElements (int idx, int num_elem, MatchConstraint value)
 
None insertElements (int index, MatchConstraintList values)
 
None popLastElement ()
 
None removeElement (int idx)
 
None removeElements (int begin_idx, int end_idx)
 
MatchConstraint getFirstElement ()
 
MatchConstraint getLastElement ()
 
MatchConstraint getElement (int idx)
 
None setElement (int idx, MatchConstraint value)
 
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)
 
MatchConstraint __getitem__ (int idx)
 
int __len__ ()
 
None __setitem__ (int index, MatchConstraint value)
 
str __str__ ()
 Returns a string representation of the MatchConstraintList instance. More...
 

Properties

 objectID = property(getObjectID)
 
 size = property(getSize)
 
 type = property(getType, setType)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.Chem.MatchConstraintList.__init__ ( MatchConstraintList  list)

Initializes a copy of the MatchConstraintList instance list.

Parameters
listThe MatchConstraintList instance to copy.

◆ __init__() [2/2]

None CDPL.Chem.MatchConstraintList.__init__ ( Type   type = CDPL.Chem.Type.AND_LIST)

Constructs the MatchConstraintList instance with the specified logical type.

Parameters
typeThe logical type of the match constraint list.

Member Function Documentation

◆ getObjectID()

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().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ assign()

MatchConstraintList CDPL.Chem.MatchConstraintList.assign ( MatchConstraintList  array)

Replaces the current state of self with a copy of the state of the MatchConstraintList instance array.

Parameters
arrayThe MatchConstraintList instance to copy.
Returns
self

◆ addElement() [1/2]

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.

Parameters
idThe identifier of the match constraint.
relThe relational constraint on the values of matching query/target attribute pairs.

◆ addElement() [2/2]

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.

Parameters
idThe identifier of the match constraint.
relThe relational constraint on the values of matching query/target attribute pairs.
valThe value of the query attribute.

◆ getType()

Type CDPL.Chem.MatchConstraintList.getType ( )

Returns the logical type of the match constraint list.

Returns
The logical type of the match constraint list.

◆ setType()

None CDPL.Chem.MatchConstraintList.setType ( Type  type)

Sets the logical type of the match constraint list.

Parameters
typeThe logical type of the match constraint list.

◆ __str__()

str CDPL.Chem.MatchConstraintList.__str__ ( )

Returns a string representation of the MatchConstraintList instance.

Returns
The generated string representation.