| Package | system.data.iterators |
| Class | public class ArrayFieldIterator |
| Inheritance | ArrayFieldIterator ArrayIterator Object |
Example :
import system.iterators.ArrayFieldIterator ;
var ar:Array =
[
{ label : "item1", date : new Date(2005, 10, 12) } ,
{ label : "item2", date : new Date(2004, 2, 22) } ,
{ label : "item3", date : new Date(2005, 4, 3) }
] ;
trace (" --- browse 'label' field") ;
var it:ArrayFieldIterator = new ArrayFieldIterator(ar, "label") ;
while (it.hasNext())
{
trace (it.next() + " : " + it.key()) ;
}
trace(" --- browse 'date' field") ;
var it:ArrayFieldIterator = new ArrayFieldIterator(ar, "date") ;
while (it.hasNext())
{
trace (it.next() + " : " + it.key()) ;
}
| Property | Defined By | ||
|---|---|---|---|
| fieldName : String
The field used in the next method to return the next value in the array. | ArrayFieldIterator | ||
| undefineable : * = null
The default undefineable value use if the field don't exist in the current object in the iterator. | ArrayFieldIterator | ||
| Method | Defined By | ||
|---|---|---|---|
ArrayFieldIterator(a:Array, fieldName:String = null)
Creates a new ArrayFieldIterator instance. | ArrayFieldIterator | ||
![]() | hasNext():Boolean
Returns true if the iteration has more elements. | ArrayIterator | |
![]() | key():*
Returns the current key of the internal pointer of the iterator (optional operation). | ArrayIterator | |
next():* [override]
Returns the next field element in the iteration. | ArrayFieldIterator | ||
![]() | remove():*
Removes from the underlying collection the last element returned by the iterator (optional operation). | ArrayIterator | |
![]() | reset():void
Reset the internal pointer of the iterator (optional operation). | ArrayIterator | |
![]() | seek(position:*):void
Changes the position of the internal pointer of the iterator (optional operation). | ArrayIterator | |
| fieldName | property |
public var fieldName:StringThe field used in the next method to return the next value in the array.
| undefineable | property |
public var undefineable:* = nullThe default undefineable value use if the field don't exist in the current object in the iterator.
| ArrayFieldIterator | () | Constructor |
public function ArrayFieldIterator(a:Array, fieldName:String = null)Creates a new ArrayFieldIterator instance.
Parametersa:Array | |
fieldName:String (default = null) |
| next | () | method |
override public function next():*Returns the next field element in the iteration.
Returns* — the next field element in the iteration.
|