Class: SC.Enumerator
An object that iterates over all of the values in an object.
An instance of this object is returned every time you call the
enumerator() method on an object that implements the SC.Enumerable
mixin.
Once you create an enumerator instance, you can call nextObject
() on it
until you can iterated through the entire collection. Once you have
exhausted the enumerator, you can reuse it if you want by calling reset().
Defined in: enumerator.js
- Since:
- SproutCore 1.0
Class Methods
Instance Methods
Class Method Detail
Use this method to manually create a new Enumerator object. Usually you will not access this method directly but instead call enumerator() on the item you want to enumerate.
- Parameters:
- enumerableObject SC.Enumerable
- enumerable object.
- Returns:
- SC.Enumerator
- the enumerator
Instance Method Detail
Releases the enumerators enumerable object. You cannot use this object anymore. This is not often needed but it is useful when you need to make sure memory gets cleared.
- Returns:
- Object
- null
- Returns:
- Object
- the next object or undefined
Resets the enumerator to the beginning. This is a nice way to reuse an existing enumerator.
- Returns:
- Object
- this