class ArrayCollection<T>
package feathers.data
extends EventDispatcher
implements IFlatCollection<T>
Wraps an Array
in the common IFlatCollection
API used for data
collections by many Feathers UI controls, including ListView
and TabBar
1.0.0
.Constructor
new(?array:Array<T>)
Creates a new ArrayCollection
object with the given arguments.
1.0.0
.Variables
array:Array<T>
The Array
data source for this collection.
The following example replaces the data source with a new array:
collection.data = [];
1.0.0
.Methods
addAllAt(collection:IFlatCollection<T>, index:Int):Void
every(callback:(item:T, index:Int, collection:ArrayCollection<T>) ‑> Bool):Bool
Using a callback that returns either true
or false
, determines if
at least one item in the collection returns true
.
1.0.0
.find(callback:(item:T, index:Int, collection:ArrayCollection<T>) ‑> Bool):T
Using a callback that returns either true
or false
, returns the
first item in the collection where the callback returns true
.
1.0.0
.findIndex(callback:(item:T, index:Int, collection:ArrayCollection<T>) ‑> Bool):Int
Using a callback that returns either true
or false
, returns the
first item in the collection where the callback returns true
.
1.0.0
.forEach(callback:(item:T, index:Int, collection:ArrayCollection<T>) ‑> Void):Void
Iterates through every item in the collection and passes it to a callback.
1.0.0
.map<U>(callback:(item:T, index:Int, collection:ArrayCollection<T>) ‑> U):ArrayCollection<U>
Creates a new collection using a callback for each item in the existing collection.
1.0.0
.some(callback:(item:T, index:Int, collection:ArrayCollection<T>) ‑> Bool):Bool
Using a callback that returns either true
or false
, determines if
at all items in the collection return true
.
1.0.0
.