Mission Base

Program Base Library Functions

int pblIteratorAdd

( PblIterator* iterator, void* element )

Inserts the specified element into the underlying collection.

Documentation

Inserts the specified element into the underlying collection.

The element is inserted immediately before the next element that would be returned by next, if any, and after the next element that would be returned by previous, if any.

If the list contains no elements, the new element becomes the sole element on the list.

The new element is inserted before the implicit cursor: a subsequent call to next would be unaffected, and a subsequent call to previous would return the new element. This call increases by one the value that would be returned by a call to nextIndex or previousIndex.

For array lists this method has a time complexity of O(N), with N being the number of elements in the underlying list.

For linked lists this method has a time complexity of O(1).

Parameters:
iterator - The iterator to add the element to
element - Element to be added to this list
Returns:
int rc >= 0: The size of the list.
int rc < 0: An error, see pbl_errno:
PBL_ERROR_OUT_OF_MEMORY - Out of memory.
PBL_ERROR_CONCURRENT_MODIFICATION - The underlying list was modified concurrently.
PBL_ERROR_PARAM_LIST - The underlying collection is not a list.

Alphabetic index



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