nsICollection

The nsICollection interface represents a list of nsISupports items. It provides basic operations on those items like: getting, setting, appending, removing, and so on.

Please add a summary to this article.
Inherits from: nsISerializable Last changed in Gecko 1.7

Method overview

void AppendElement(in nsISupports item);
void Clear();
PRUint32 Count();
nsIEnumerator Enumerate();
nsISupports GetElementAt(in PRUint32 index);
void QueryElementAt(in PRUint32 index, in nsIIDRef uuid, [iid_is(uuid),retval] out nsQIResult result);
void RemoveElement(in nsISupports item);
void SetElementAt(in PRUint32 index, in nsISupports item);

Methods

AppendElement()

void AppendElement(
  in nsISupports item
);
Parameters
item
nsISupports item to be appended to the list.

Clear()

void Clear();
Parameters

None.

Count()

PRUint32 Count();
Parameters

None.

Return value

Number of items in the list.

Enumerate()

nsIEnumerator Enumerate();
Parameters

None.

Return value

An nsIEnumerator.

GetElementAt()

nsISupports GetElementAt(
  in PRUint32 index
);
Parameters
index
The index position of the item to be returned.
Return value

nsISupports item at the index position.

QueryElementAt()

void QueryElementAt(
  in PRUint32 index,
  in nsIIDRef uuid,
  [iid_is(uuid),retval] out nsQIResult result
);
Parameters
index
Position of the item to be queried.
uuid
nsIIDRef of the item.
result
Comparison result of the previous two parameters.


RemoveElement()

void RemoveElement(
  in nsISupports item
);
Parameters
item
nsISupports item to be removed from the list.


SetElementAt()

void SetElementAt(
  in PRUint32 index,
  in nsISupports item
);
Parameters
index
Index position where the new item will be set.
item
The nsISupports item to be set in that position.


Remarks

nsIEnumerator is a broken interface, and nsISimpleEnumerator should be used in its place.

See also

nsISupports
nsIEnumerator
nsISimpleEnumerator