![]() |
Chemical Data Processing Library Python API - Version 1.4.0
|
Array storing unsigned integers of type unsigned int.
More...
Inheritance diagram for CDPL.Util.UIArray:Public Member Functions | |
| None | __init__ () |
| Creates an empty array. | |
| None | __init__ (UIArray array) |
Contructs a copy of the UIArray instance array. 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 array. More... | |
| bool | isEmpty () |
Tells whether the array is empty (getSize() == 0). More... | |
| None | resize (int num_elem, int 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. | |
| UIArray | assign (UIArray array) |
Replaces the current state with a copy of the state of the UIArray instance array. More... | |
| None | assign (int num_elem, int value) |
| This function fills the array with num_elem copies of the given value. More... | |
| None | addElement (int value) |
| Adds a new element at the end of the array. More... | |
| None | addElements (UIArray values) |
| Adds the elements of values to the end of the array. More... | |
| None | insertElement (int idx, int value) |
| Inserts a new element before the location specified by the index idx. More... | |
| None | insertElements (int idx, int num_elem, int value) |
| Inserts num_elem copies of value before the location specified by the index idx. More... | |
| None | insertElements (int idx, UIArray values) |
| Insert the elements of values before the location specified by the index idx. More... | |
| None | popLastElement () |
| Removes the last element of the array. 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... | |
| int | getFirstElement () |
| Returns the first element of the array. More... | |
| int | getLastElement () |
| Returns the last element of the array. More... | |
| int | getElement (int idx) |
| Returns the element at index idx. More... | |
| None | setElement (int idx, int value) |
| Assigns a new value to the element at index idx. More... | |
| None | __delitem__ (int idx) |
| Removes the element at index idx. More... | |
| int | __getitem__ (int idx) |
| Returns the element at index idx. More... | |
| int | __len__ () |
| Returns the number of elements stored in the array. More... | |
| None | __setitem__ (int idx, int value) |
| Assigns a new value to the element at index idx. More... | |
| bool | __eq__ (UIArray array) |
Returns the result of the comparison operation self == array. More... | |
| bool | __ne__ (UIArray array) |
Returns the result of the comparison operation self != array. More... | |
| bool | __le__ (UIArray array) |
Returns the result of the comparison operation self <= array. More... | |
| bool | __ge__ (UIArray array) |
Returns the result of the comparison operation self >= array. More... | |
| bool | __lt__ (UIArray array) |
Returns the result of the comparison operation self < array. More... | |
| bool | __gt__ (UIArray array) |
Returns the result of the comparison operation self > array. More... | |
Properties | |
| objectID = property(getObjectID) | |
| size = property(getSize) | |
Array storing unsigned integers of type unsigned int.
| None CDPL.Util.UIArray.__init__ | ( | UIArray | array | ) |
| int CDPL.Util.UIArray.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python UIArray 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 UIArray 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.Util.UIArray.getSize | ( | ) |
Returns the number of elements stored in the array.
| bool CDPL.Util.UIArray.isEmpty | ( | ) |
Tells whether the array is empty (getSize() == 0).
True if the array is empty, False otherwise. | None CDPL.Util.UIArray.resize | ( | int | num_elem, |
| int | 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.Util.UIArray.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.Util.UIArray.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.
| None CDPL.Util.UIArray.assign | ( | int | num_elem, |
| int | 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.Util.UIArray.addElement | ( | int | value | ) |
Adds a new element at the end of the array.
| value | The value of the new element. |
| None CDPL.Util.UIArray.addElements | ( | UIArray | values | ) |
Adds the elements of values to the end of the array.
| values | The UIArray instance providing the elements to add. |
| None CDPL.Util.UIArray.insertElement | ( | int | idx, |
| int | 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.Util.UIArray.insertElements | ( | int | idx, |
| int | num_elem, | ||
| int | 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.Util.UIArray.insertElements | ( | int | idx, |
| UIArray | values | ||
| ) |
Insert the elements of values before the location specified by the index idx.
| idx | The zero-based insertion index. |
| values | The UIArray instance providing the elements to insert. |
| Base.IndexError | if idx is not in the range [0, getSize()]. |
| None CDPL.Util.UIArray.popLastElement | ( | ) |
Removes the last element of the array.
| Base.OperationFailed | if the array is empty. |
| None CDPL.Util.UIArray.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.Util.UIArray.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. |
| int CDPL.Util.UIArray.getFirstElement | ( | ) |
Returns the first element of the array.
| Base.OperationFailed | if the array is empty. |
| int CDPL.Util.UIArray.getLastElement | ( | ) |
Returns the last element of the array.
| Base.OperationFailed | if the array is empty. |
| int CDPL.Util.UIArray.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.Util.UIArray.setElement | ( | int | idx, |
| int | 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()). |
| None CDPL.Util.UIArray.__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()). |
| int CDPL.Util.UIArray.__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.Util.UIArray.__len__ | ( | ) |
Returns the number of elements stored in the array.
| None CDPL.Util.UIArray.__setitem__ | ( | int | idx, |
| int | 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()). |
| bool CDPL.Util.UIArray.__eq__ | ( | UIArray | array | ) |
Returns the result of the comparison operation self == array.
| array | The UIArray instance to be compared with. |
| bool CDPL.Util.UIArray.__ne__ | ( | UIArray | array | ) |
Returns the result of the comparison operation self != array.
| array | The UIArray instance to be compared with. |
| bool CDPL.Util.UIArray.__le__ | ( | UIArray | array | ) |
Returns the result of the comparison operation self <= array.
| array | The UIArray instance to be compared with. |
| bool CDPL.Util.UIArray.__ge__ | ( | UIArray | array | ) |
Returns the result of the comparison operation self >= array.
| array | The UIArray instance to be compared with. |
| bool CDPL.Util.UIArray.__lt__ | ( | UIArray | array | ) |
Returns the result of the comparison operation self < array.
| array | The UIArray instance to be compared with. |