| Package | com.ericfeminella.collections |
| Class | public class CollectionIterator |
| Implements | Iterator |
Iterator implementation which provides an API
for iterating over an ICollectionView.
CollectionIterator
example:
var collection:ICollectionView = new ArrayCollection( ["a","b","c"] );
var it:Iterator = new CollectionIterator( collection );
while ( it.hasNext() )
{
trace( it.next(), it.position() );
}
// a, 0
// b, 1
// c, 2
See also
| Property | Defined by | ||
|---|---|---|---|
| collection : ICollectionView
Defines the
ICollectionView instance
| CollectionIterator | ||
| cursor : IViewCursor
Defines the
IViewCursor instance to the aggregate
| CollectionIterator | ||
| index : int
Contains the current indexed position in the collection
| CollectionIterator | ||
| Method | Defined by | ||
|---|---|---|---|
|
CollectionIterator(collection:ICollectionView)
Instantiates a new
CollectionIterator instance
| CollectionIterator | ||
|
hasNext():Boolean
Determines if there are elements remaining in the ICollectionView
| CollectionIterator | ||
|
next():*
Returns the next item in the ICollectionView
| CollectionIterator | ||
|
position():int
Determines the IViewCursor position of the ICollectionView
| CollectionIterator | ||
|
reset():void
Resets the IViewCursor to a zero based indexed position
| CollectionIterator | ||
|
setCollection(collection:ICollectionView):void
Sets the collection in which to iterate over
| CollectionIterator | ||
| collection | property |
protected var collection:ICollectionView
Defines the ICollectionView instance
See also
| cursor | property |
protected var cursor:IViewCursor
Defines the IViewCursor instance to the aggregate
See also
| index | property |
protected var index:intContains the current indexed position in the collection
| CollectionIterator | () | constructor |
public function CollectionIterator(collection:ICollectionView)
Instantiates a new CollectionIterator instance
collection:ICollectionView — collection in which to iterate over
|
| hasNext | () | method |
public function hasNext():BooleanDetermines if there are elements remaining in the ICollectionView
ReturnsBoolean — true if an element remains, false if not
|
| next | () | method |
public function next():*Returns the next item in the ICollectionView
Returns* |
| position | () | method |
public function position():intDetermines the IViewCursor position of the ICollectionView
Returnsint — the current position of the aggreagate
|
| reset | () | method |
public function reset():voidResets the IViewCursor to a zero based indexed position
See also
| setCollection | () | method |
public function setCollection(collection:ICollectionView):voidSets the collection in which to iterate over
Parameterscollection:ICollectionView — ICollectionView instance
|