Visit Mozilla.org

nsISimpleEnumerator

From MDC

« XPCOM API Reference

Contents

[edit] Summary

The nsISimpleEnumerator interface represents an enumeration of XPCOM objects and provides methods to access elements sequentially.

#include "nsISimpleEnumerator.h"

[scriptable, uuid=(D1899240-F9D2-11D2-BDD6-000064657374)]
interface nsISimpleEnumerator : nsISupports { ... };

[edit] Methods

hasMoreElements
This method returns true if there are more XPCOM objects in the enumeration.
getNext
This method returns the next XPCOM object in the enumeration.

[edit] Remarks

Although hasMoreElements can be called independently of getNext, getNext must be preceded by a call to hasMoreElements.

There is no way to "reset" an nsISimpleEnumerator instance.

[edit] History

This interface was frozen for Mozilla 0.9.6. See bug 154047 for details.

[edit] Example

Code example of nsISimpleEnumerator