nsICollection 编辑
xpcom/ds/nsICollection.idl
Scriptable This interface represents a list of nsISupports items. It provides basic operations on those items like: getting, setting, appending, removing, and so on. Inherits from: nsISerializable
Last changed in Gecko 1.7Method 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()
Appends a new item to the collection.
void AppendElement( in nsISupports item )
Parameters
item
nsISupports
item to be appended to the list.
Clear()
Removes all items from the collection.
void Clear();
Parameters
None.
Count()
Returns the number of items in the collection.
PRUint32 Count();
Parameters
None.
Return value
Number of items in the list.
Enumerate()
Returns an nsIEnumerator
that lets you iterate over the items in the collection.
nsIEnumerator Enumerate();
Parameters
None.
Return value
An nsIEnumerator
.
GetElementAt()
Returns the element at the specified index into the collection.
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()
Performs a QueryInterface
on the item at the specified index into the collection.
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()
Removes an item from the collection.
void RemoveElement( in nsISupports item );
Parameters
item
nsISupports
item to be removed from the list.
SetElementAt()
Replaces an item at a specified index in the collection with a new one.
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论