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

A single data item (column) of an mmCIF category, holding an ordered list of string values. More...

+ Inheritance diagram for CDPL.Biomol.MMCIFData.Item:

Public Member Functions

None __init__ (str name)
 Constructs an empty Item with the data-item name name. More...
 
None __init__ (Item item)
 Initializes a copy of the Item instance item. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
Item assign (Item item)
 Replaces the current state of self with a copy of the state of the Item instance item. More...
 
None swap (Item cat)
 
None clear ()
 Removes all values from the item.
 
str getName ()
 
int getNumValues ()
 Returns the number of values stored in the item. More...
 
str getValue (int index)
 Returns the value at the zero-based index index. More...
 
None setValue (int index, str value)
 Replaces the value at the zero-based index index by moving value. More...
 
None addValue (str value)
 Appends the value value to the item's value list by moving. More...
 
None removeValue (int index)
 Removes the value at the zero-based index index. More...
 
int __len__ ()
 
str __getitem__ (int index)
 
None __delitem__ (int index)
 
None __setitem__ (int index, str value)
 

Properties

 objectID = property(getObjectID)
 
 numValues = property(getNumValues)
 
 name = property(getName)
 

Detailed Description

A single data item (column) of an mmCIF category, holding an ordered list of string values.

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.Biomol.MMCIFData.Item.__init__ ( str  name)

Constructs an empty Item with the data-item name name.

Parameters
nameThe fully-qualified mmCIF data-item name (including the _ prefix).

◆ __init__() [2/2]

None CDPL.Biomol.MMCIFData.Item.__init__ ( Item  item)

Initializes a copy of the Item instance item.

Parameters
itemThe Item instance to copy.

Member Function Documentation

◆ getObjectID()

int CDPL.Biomol.MMCIFData.Item.getObjectID ( )

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

Different Python Item 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 Item 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()

Item CDPL.Biomol.MMCIFData.Item.assign ( Item  item)

Replaces the current state of self with a copy of the state of the Item instance item.

Parameters
itemThe Item instance to copy.
Returns
self

◆ swap()

None CDPL.Biomol.MMCIFData.Item.swap ( Item  cat)
Parameters
cat

◆ getName()

str CDPL.Biomol.MMCIFData.Item.getName ( )
Parameters
arg1
Returns

◆ getNumValues()

int CDPL.Biomol.MMCIFData.Item.getNumValues ( )

Returns the number of values stored in the item.

Returns
The value count.

◆ getValue()

str CDPL.Biomol.MMCIFData.Item.getValue ( int  index)

Returns the value at the zero-based index index.

Parameters
indexThe zero-based value index.
Returns
A reference to the value.
Exceptions
Base.IndexErrorif the number of values is zero or index is not in the range [0, getNumValues() - 1].

◆ setValue()

None CDPL.Biomol.MMCIFData.Item.setValue ( int  index,
str  value 
)

Replaces the value at the zero-based index index by moving value.

Parameters
indexThe zero-based value index.
valueThe new value to move-assign.
Exceptions
Base.IndexErrorif the number of values is zero or index is not in the range [0, getNumValues() - 1].

◆ addValue()

None CDPL.Biomol.MMCIFData.Item.addValue ( str  value)

Appends the value value to the item's value list by moving.

Parameters
valueThe value to move-append.

◆ removeValue()

None CDPL.Biomol.MMCIFData.Item.removeValue ( int  index)

Removes the value at the zero-based index index.

Parameters
indexThe zero-based value index.
Exceptions
Base.IndexErrorif the number of values is zero or index is not in the range [0, getNumValues() - 1].

◆ __len__()

int CDPL.Biomol.MMCIFData.Item.__len__ ( )
Returns

◆ __getitem__()

str CDPL.Biomol.MMCIFData.Item.__getitem__ ( int  index)
Parameters
index
Returns

◆ __delitem__()

None CDPL.Biomol.MMCIFData.Item.__delitem__ ( int  index)
Parameters
index

◆ __setitem__()

None CDPL.Biomol.MMCIFData.Item.__setitem__ ( int  index,
str  value 
)
Parameters
index
value