Wraps an Array in the common IFlatCollection API used for data collections by many Feathers UI controls, including ListView and TabBar.

Events:

openfl.events.Event.CHANGE
feathers.events.FlatCollectionEvent.ADD_ITEM
feathers.events.FlatCollectionEvent.REMOVE_ITEM
feathers.events.FlatCollectionEvent.REPLACE_ITEM
feathers.events.FlatCollectionEvent.REMOVE_ALL
feathers.events.FlatCollectionEvent.RESET
feathers.events.FlatCollectionEvent.UPDATE_ITEM
feathers.events.FlatCollectionEvent.UPDATE_ALL
feathers.events.FlatCollectionEvent.FILTER_CHANGE
feathers.events.FlatCollectionEvent.SORT_CHANGE
Available since

1.0.0

.

Constructor

new(?array:Array<T>)

Creates a new ArrayCollection object with the given arguments.

Available since

1.0.0

.

Variables

@:flash.propertyarray:Array<T>

The Array data source for this collection.

The following example replaces the data source with a new array:

collection.array = [];
Available since

1.0.0

.

@:flash.propertyread onlylength:Int

@:flash.propertyfilterFunction:T ‑> Bool

Methods

addAllAt(collection:IFlatCollection<T>, index:Int):Void

addAt(item: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.

Available since

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.

Available since

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.

Available since

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.

Available since

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.

Available since

1.0.0

.

@:value({ collection : null })reset(?collection:IFlatCollection<T>):Void

set(index:Int, item:T):Void

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.

Available since

1.0.0

.