Mission Base

Program Base Library Functions

int pblListAddAllAt

( PblList* list, int index,
  void* collection )

Inserts all of the elements in the specified collection into this list at the specified position.

Documentation

Inserts all of the elements in the specified collection into this list at the specified position.

Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator.

The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)

For array lists adding to the end of the list has a time complexity of O(M), while adding to the beginning of the list has a time complexity of O(N + M) with N being the number of elements in the list and M being the size of the collection whose elements are added.

For linked lists adding to beginning or the end of the list has a time complexity of O(M), while adding to a random position in the middle of the list has a time complexity of O(N + M) with N being the number of elements in the list and M being the size of the collection whose elements are added.

Parameters:
list - The list to use
index - Index at which the element are to be inserted
collection - The collection whose elements are to be added to this list.
Returns:
int rc >= 0: The size of this list instance.
int rc < 0: An error, see pbl_errno:
PBL_ERROR_OUT_OF_MEMORY - Out of memory.
PBL_ERROR_OUT_OF_BOUNDS - Index is out of range, (index < 0 || index >= size()).
PBL_ERROR_PARAM_LIST - Collection cannot be iterated.
PBL_ERROR_CONCURRENT_MODIFICATION - Collection was modified concurrently.

Alphabetic index



This page was generated with the help of DOC++.