Chemical Data Processing Library Python API - Version 1.1.1
Public Member Functions | Properties | List of all members
CDPL.MolProp.MassComposition Class Reference

A data type for the storage of mass percent compositions of chemical compounds. More...

+ Inheritance diagram for CDPL.MolProp.MassComposition:

Public Member Functions

None __init__ ()
 Initializes the MassComposition instance.
 
None __init__ (MassComposition mass_comp)
 Initializes a copy of the MassComposition instance mass_comp. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
int getSize ()
 
bool isEmpty ()
 
None clear ()
 
MassComposition assign (MassComposition map)
 Replaces the current state of self with a copy of the state of the MassComposition instance map. More...
 
float getValue (int key)
 
float getValue (int key, float def_value)
 
bool removeEntry (int key)
 
None setEntry (int key, float value)
 
object getKeys ()
 
object keys ()
 
object getValues ()
 
object values ()
 
object getEntries ()
 
object items ()
 
bool containsEntry (int key)
 
bool insertEntry (int key, float value)
 
int __len__ ()
 
float __getitem__ (int key)
 
None __setitem__ (int key, float value)
 
bool __delitem__ (int key)
 
bool __contains__ (int key)
 Returns the result of the membership test operation key in self. More...
 
bool __eq__ (object mass_comp)
 Returns the result of the comparison operation self == mass_comp. More...
 
bool __ne__ (object mass_comp)
 Returns the result of the comparison operation self != mass_comp. More...
 
bool __le__ (object mass_comp)
 Returns the result of the comparison operation self <= mass_comp. More...
 
bool __ge__ (object mass_comp)
 Returns the result of the comparison operation self >= mass_comp. More...
 
bool __lt__ (object mass_comp)
 Returns the result of the comparison operation self < mass_comp. More...
 
bool __gt__ (object mass_comp)
 Returns the result of the comparison operation self > mass_comp. More...
 

Properties

 objectID = property(getObjectID)
 
 size = property(getSize)
 

Detailed Description

A data type for the storage of mass percent compositions of chemical compounds.

MassComposition is an unique associative map where the keys specify the atom type (defined in namespace Chem.AtomType) of the chemical elements and the mapped floating-point values correspond to the percentage contribution of the elements to the total mass of the compound.

Constructor & Destructor Documentation

◆ __init__()

None CDPL.MolProp.MassComposition.__init__ ( MassComposition  mass_comp)

Initializes a copy of the MassComposition instance mass_comp.

Parameters
mass_compThe MassComposition instance to copy.

Member Function Documentation

◆ getObjectID()

int CDPL.MolProp.MassComposition.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python MassComposition 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 MassComposition 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.

◆ getSize()

int CDPL.MolProp.MassComposition.getSize ( )
Returns

◆ isEmpty()

bool CDPL.MolProp.MassComposition.isEmpty ( )
Returns

◆ assign()

MassComposition CDPL.MolProp.MassComposition.assign ( MassComposition  map)

Replaces the current state of self with a copy of the state of the MassComposition instance map.

Parameters
mapThe MassComposition instance to copy.
Returns
self

◆ getValue() [1/2]

float CDPL.MolProp.MassComposition.getValue ( int  key)
Parameters
key
Returns

◆ getValue() [2/2]

float CDPL.MolProp.MassComposition.getValue ( int  key,
float  def_value 
)
Parameters
key
def_value
Returns

◆ removeEntry()

bool CDPL.MolProp.MassComposition.removeEntry ( int  key)
Parameters
key
Returns

◆ setEntry()

None CDPL.MolProp.MassComposition.setEntry ( int  key,
float  value 
)
Parameters
key
value

◆ getKeys()

object CDPL.MolProp.MassComposition.getKeys ( )
Returns

◆ keys()

object CDPL.MolProp.MassComposition.keys ( )
Returns

◆ getValues()

object CDPL.MolProp.MassComposition.getValues ( )
Returns

◆ values()

object CDPL.MolProp.MassComposition.values ( )
Returns

◆ getEntries()

object CDPL.MolProp.MassComposition.getEntries ( )
Returns

◆ items()

object CDPL.MolProp.MassComposition.items ( )
Returns

◆ containsEntry()

bool CDPL.MolProp.MassComposition.containsEntry ( int  key)
Parameters
key
Returns

◆ insertEntry()

bool CDPL.MolProp.MassComposition.insertEntry ( int  key,
float  value 
)
Parameters
key
value
Returns

◆ __len__()

int CDPL.MolProp.MassComposition.__len__ ( )
Returns

◆ __getitem__()

float CDPL.MolProp.MassComposition.__getitem__ ( int  key)
Parameters
key
Returns

◆ __setitem__()

None CDPL.MolProp.MassComposition.__setitem__ ( int  key,
float  value 
)
Parameters
key
value

◆ __delitem__()

bool CDPL.MolProp.MassComposition.__delitem__ ( int  key)
Parameters
key
Returns

◆ __contains__()

bool CDPL.MolProp.MassComposition.__contains__ ( int  key)

Returns the result of the membership test operation key in self.

Parameters
keyThe value to test for membership.
Returns
The result of the membership test operation.

◆ __eq__()

bool CDPL.MolProp.MassComposition.__eq__ ( object  mass_comp)

Returns the result of the comparison operation self == mass_comp.

Parameters
mass_compThe object instance to be compared with.
Returns
The result of the comparison operation.

◆ __ne__()

bool CDPL.MolProp.MassComposition.__ne__ ( object  mass_comp)

Returns the result of the comparison operation self != mass_comp.

Parameters
mass_compThe object instance to be compared with.
Returns
The result of the comparison operation.

◆ __le__()

bool CDPL.MolProp.MassComposition.__le__ ( object  mass_comp)

Returns the result of the comparison operation self <= mass_comp.

Parameters
mass_compThe object instance to be compared with.
Returns
The result of the comparison operation.

◆ __ge__()

bool CDPL.MolProp.MassComposition.__ge__ ( object  mass_comp)

Returns the result of the comparison operation self >= mass_comp.

Parameters
mass_compThe object instance to be compared with.
Returns
The result of the comparison operation.

◆ __lt__()

bool CDPL.MolProp.MassComposition.__lt__ ( object  mass_comp)

Returns the result of the comparison operation self < mass_comp.

Parameters
mass_compThe object instance to be compared with.
Returns
The result of the comparison operation.

◆ __gt__()

bool CDPL.MolProp.MassComposition.__gt__ ( object  mass_comp)

Returns the result of the comparison operation self > mass_comp.

Parameters
mass_compThe object instance to be compared with.
Returns
The result of the comparison operation.