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

A data structure for the storage of imported PDB data records (see [CTFILE]). More...

+ Inheritance diagram for CDPL.Biomol.PDBData:

Classes

class  RecordType
 Identifies a PDB record type. More...
 

Public Member Functions

None __init__ ()
 Constructs an empty PDBData instance.
 
None __init__ (PDBData data)
 Initializes a copy of the PDBData instance data. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
int getNumRecords ()
 Returns the number of stored records. More...
 
bool isEmpty ()
 Tells whether no records are stored. More...
 
None clear ()
 Removes all stored records.
 
PDBData assign (PDBData data)
 Replaces the current state of self with a copy of the state of the PDBData instance data. More...
 
bool containsRecord (RecordType type)
 Tells whether a record of the given type is stored. More...
 
str getData (RecordType type)
 Returns the data string associated with the given record type. More...
 
bool removeRecord (RecordType type)
 Removes the record of the given type. More...
 
None setRecord (RecordType type, str data)
 Stores a record built from type and data. More...
 
object getRecordTypes ()
 
object getRecordData ()
 
object getRecords ()
 
int __len__ ()
 
str __getitem__ (RecordType type)
 
None __setitem__ (RecordType type, str data)
 
bool __delitem__ (RecordType type)
 
bool __contains__ (RecordType type)
 Returns the result of the membership test operation type in self. More...
 

Properties

 objectID = property(getObjectID)
 
 numRecords = property(getNumRecords)
 
 recordTypes = property(getRecordTypes)
 
 recordData = property(getRecordData)
 
 records = property(getRecords)
 

Detailed Description

A data structure for the storage of imported PDB data records (see [CTFILE]).

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Biomol.PDBData.__init__ ( PDBData  data)

Initializes a copy of the PDBData instance data.

Parameters
dataThe PDBData instance to copy.

Member Function Documentation

◆ getObjectID()

int CDPL.Biomol.PDBData.getObjectID ( )

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

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

◆ getNumRecords()

int CDPL.Biomol.PDBData.getNumRecords ( )

Returns the number of stored records.

Returns
The number of records.

◆ isEmpty()

bool CDPL.Biomol.PDBData.isEmpty ( )

Tells whether no records are stored.

Returns
True if no records are stored, and False otherwise.

◆ assign()

PDBData CDPL.Biomol.PDBData.assign ( PDBData  data)

Replaces the current state of self with a copy of the state of the PDBData instance data.

Parameters
dataThe PDBData instance to copy.
Returns
self

◆ containsRecord()

bool CDPL.Biomol.PDBData.containsRecord ( RecordType  type)

Tells whether a record of the given type is stored.

Parameters
typeThe queried record type.
Returns
True if a record of the given type is stored, and False otherwise.

◆ getData()

str CDPL.Biomol.PDBData.getData ( RecordType  type)

Returns the data string associated with the given record type.

Parameters
typeThe record type whose data is requested.
Returns
A reference to the data string.
Exceptions
Base.ItemNotFoundif no record of the given type is stored.

◆ removeRecord()

bool CDPL.Biomol.PDBData.removeRecord ( RecordType  type)

Removes the record of the given type.

Parameters
typeThe type of the record to remove.
Returns
True if the record was removed, and False if no matching record existed.

◆ setRecord()

None CDPL.Biomol.PDBData.setRecord ( RecordType  type,
str  data 
)

Stores a record built from type and data.

Any pre-existing record of the same type is replaced.

Parameters
typeThe record type.
dataThe record data string.
Returns
An iterator referencing the stored record.

◆ getRecordTypes()

object CDPL.Biomol.PDBData.getRecordTypes ( )
Returns

◆ getRecordData()

object CDPL.Biomol.PDBData.getRecordData ( )
Returns

◆ getRecords()

object CDPL.Biomol.PDBData.getRecords ( )
Returns

◆ __len__()

int CDPL.Biomol.PDBData.__len__ ( )
Returns

◆ __getitem__()

str CDPL.Biomol.PDBData.__getitem__ ( RecordType  type)
Parameters
type
Returns

◆ __setitem__()

None CDPL.Biomol.PDBData.__setitem__ ( RecordType  type,
str  data 
)
Parameters
type
data

◆ __delitem__()

bool CDPL.Biomol.PDBData.__delitem__ ( RecordType  type)
Parameters
type
Returns

◆ __contains__()

bool CDPL.Biomol.PDBData.__contains__ ( RecordType  type)

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

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