nsIMutableArray

IID:af059da0-c85b-40ec-af07-ae4bfdc192cc
Inherits From:nsIArray

This interface is implemented by the following components:


Methods

void appendElement ( nsISupports element , PRBool weak ) void clear ( ) void insertElementAt ( nsISupports element , PRUint32 index , PRBool weak ) void removeElementAt ( PRUint32 index ) void replaceElementAt ( nsISupports element , PRUint32 index , PRBool weak )

void appendElement ( nsISupports element , PRBool weak )

AppendElement()

Append an element at the end of the array.

Arguments:
element: The element to append.
weak: Whether or not to store the element using a weak reference.

void clear ( )

Clear()

Clear the entire array, releasing all stored objects


void insertElementAt ( nsISupports element , PRUint32 index , PRBool weak )

InsertElementAt()

Insert an element at the given position, moving the element currently located in that position, and all elements in higher position, up by one.

Arguments:
element: The element to insert
index: The position in the array: If the position is lower than the current length of the array, the elements at that position and onwards are bumped one position up. If the position is equal to the current length of the array, the new element is appended. An index lower than 0 or higher than the current length of the array is invalid and will be ignored.
weak

void removeElementAt ( PRUint32 index )

RemoveElementAt()

Remove an element at a specific position, moving all elements stored at a higher position down one. To remove a specific element, use indexOf() to find the index first, then call removeElementAt().

Arguments:
index: the position of the item

void replaceElementAt ( nsISupports element , PRUint32 index , PRBool weak )

ReplaceElementAt()

Replace the element at the given position.

Arguments:
element: The new element to insert
index: The position in the array If the position is lower than the current length of the array, an existing element will be replaced. If the position is equal to the current length of the array, the new element is appended. If the position is higher than the current length of the array, empty elements are appended followed by the new element at the specified position. An index lower than 0 is invalid and will be ignored.
weak: Whether or not to store the new element using a weak reference.

References

This interface is the type of the following properties:

nsIASN1Sequence.ASN1Objects, nsIAbLDAPDirectory.searchClientControls, nsIAbLDAPDirectory.searchServerControls, nsIDialogParamBlock.objects, nsILDAPAutoCompleteSession.searchClientControls, nsILDAPAutoCompleteSession.searchServerControls, nsILDAPOperation.clientControls, nsILDAPOperation.serverControls

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com