Interface for collections of flat data, such as arrays or other lists.

Available since

1.0.0

.

Variables

read onlylength:Int

The number of items in the collection.

Available since

1.0.0

.

filterFunction:T ‑> Bool

A function to determine if each item in the collection should be included or excluded from visibility through APIs like length and get().

Available since

1.0.0

.

sortCompareFunction:T ‑> T ‑> Int

A function to compare each item in the collection to determine the order when sorted.

The return value should be -1 if the first item should appear before the second item when the collection is sorted. The return value should be 1 if the first item should appear after the second item when the collection is sorted. Finally, the return value should be 0 if both items have the same sort order.

Available since

1.0.0

.

Methods

add (item:T):Void

Inserts an item at the end of the collection, increasing the length by one.

Available since

1.0.0

.

addAll (collection:IFlatCollection<T>):Void

Available since

1.0.0

.

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

Available since

1.0.0

.

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

Inserts an item into the collection at the specified index, increasing the length by one.

Available since

1.0.0

.

contains (item:T):Bool

Determines if the collection contains the specified item.

Available since

1.0.0

.

get (index:Int):T

Returns the item at the specified index in the collection.

Available since

1.0.0

.

indexOf (item:T):Int

Returns the index of the specified item, or -1 if the item is not in the collection.

Available since

1.0.0

.

iterator ():Iterator<T>

Available since

1.0.0

.

refresh ():Void

Refreshes the collection using the filterFunction or sortCompareFunction without passing in a new values for these properties. Useful when either of these functions relies on external variables that have changed.

Available since

1.0.0

.

remove (item:T):Void

Removes a specific item from the collection, decreasing the length by one, if the item is in the collection.

Available since

1.0.0

.

removeAll ():Void

Removes all items from the collection, decreasing its length to zero.

Available since

1.0.0

.

removeAt (index:Int):T

Removes an item from the collection at the specified index, decreasing the length by one.

Available since

1.0.0

.

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

Available since

1.0.0

.

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

Replaces the item at the specified index in the collection with a new item.

Available since

1.0.0

.

updateAll ():Void

Notifies components using the collection that all items should be considered changed.

Available since

1.0.0

.

See:

updateAt

updateAt (index:Int):Void

Notifies components using the collection that an item at the specified index has changed.

Available since

1.0.0

.

See:

updateAll