Packageraix.interactive
Classpublic class Enumerable
InheritanceEnumerable Inheritance Object

Provides static methods that create IEnumerable sequences



Public Methods
 MethodDefined By
  
create(moveNext:Function, getCurrent:Function):IEnumerable
[static] Creates an enumerable sequence that uses callbacks
Enumerable
  
[static] Creates an empty sequence
Enumerable
  
fromArray(array:Array):IEnumerable
[static] Creates an enumerable sequence from an array
Enumerable
  
fromProxy(proxy:Proxy):IEnumerable
[static] Creates a sequence from an enumerable proxy object
Enumerable
  
generate(initialState:Object, predicate:Function, iterate:Function, resultMap:Function):IEnumerable
[static] Creates an enumerable sequence by calling back to functions that mainpulate its state
Enumerable
  
range(start:int, count:int):IEnumerable
[static] Creates an enumerable sequence that contains the numbers in a specified range
Enumerable
  
repeat(val:Object, count:int):IEnumerable
[static] Creates an enumerable sequence that repeats a value
Enumerable
  
value(value:Object):IEnumerable
[static] Creates a sequence that contains a single value
Enumerable
Method Detail
create()method
public static function create(moveNext:Function, getCurrent:Function):IEnumerable

Creates an enumerable sequence that uses callbacks

Parameters

moveNext:Function — Moves to the next item in the sequence, returning false when no more items exist: function():Boolean
 
getCurrent:Function — Retrieves the current value in the sequence: function():TElement

Returns
IEnumerable — An IEnumerable that contains values of type TElement
empty()method 
public static function empty():IEnumerable

Creates an empty sequence

Returns
IEnumerable
fromArray()method 
public static function fromArray(array:Array):IEnumerable

Creates an enumerable sequence from an array

Parameters

array:Array — The array to enumerate

Returns
IEnumerable — An IEnumerable containing values of the same type as array
fromProxy()method 
public static function fromProxy(proxy:Proxy):IEnumerable

Creates a sequence from an enumerable proxy object

Parameters

proxy:Proxy — A enumerable proxy

Returns
IEnumerable — A sequence that will enumerate through the values in the proxy
generate()method 
public static function generate(initialState:Object, predicate:Function, iterate:Function, resultMap:Function):IEnumerable

Creates an enumerable sequence by calling back to functions that mainpulate its state

Parameters

initialState:Object — The initial state value
 
predicate:Function — A function called once for every value (including initialState), returns true while the sequence has more values: function(state : TState) : Boolean
 
iterate:Function — A function called once for every value (excluding initialState) and returns the new value for state: function(state : TState) : TState
 
resultMap:Function — A function that maps the current state to a value: function(state : TState) : TResult

Returns
IEnumerable — An IEnumerable sequence that contains values of type TResult
range()method 
public static function range(start:int, count:int):IEnumerable

Creates an enumerable sequence that contains the numbers in a specified range

Parameters

start:int — The start value
 
count:int — The number of values to enumerate, including start

Returns
IEnumerable — An IEnumerable of int values in the specified range
repeat()method 
public static function repeat(val:Object, count:int):IEnumerable

Creates an enumerable sequence that repeats a value

Parameters

val:Object — The value to repeat
 
count:int — The number of times to repeat. A value of 0 will repeat indefinately

Returns
IEnumerable — An IEnumerable containing the repeated value
value()method 
public static function value(value:Object):IEnumerable

Creates a sequence that contains a single value

Parameters

value:Object — The value to wrap in a sequence

Returns
IEnumerable — A sequence containing the specified value