Package | com.yworks.support |
Interface | public interface List extends Collection, Iterable |
Implementors | ArrayList, EmptyList, ReadOnlyList, SingletonList, YList |
Method | Defined By | ||
---|---|---|---|
Adds all of the elements in the specified collection to this collection (optional operation). | Collection | ||
addItem(item:Object):Boolean
Adds the specified item to this collection. | Collection | ||
clear():void
Removes all of the elements from this collection. | Collection | ||
contains(item:Object):Boolean
Returns true if this collection contains the specified element. | Collection | ||
getItemAt(index:int):Object
Returns the element at the specified position in this collection. | Collection | ||
indexOf(item:Object):int
Returns the index of the first occurrence of the specified element in this list,
or -1 if this list does not contain the element. | List | ||
insert(item:Object, index:uint):void
Inserts the specified element at the specified position in this list. | List | ||
isEmpty():Boolean
Returns true if this collection contains no elements. | Collection | ||
Returns an iterator over a set of elements. | Iterable | ||
length():uint
Returns the number of elements in this collection. | Collection | ||
removeAt(index:uint):void
Removes the element at the specified position in this list. | List | ||
removeItem(item:Object):Boolean
Removes a single instance of the specified element from this collection, if it is present (optional operation). | Collection | ||
sort(comparisonFunction:Function = null, sortOptions:int = -1):void
Sorts the List by using a comparisionFunction. | List | ||
toArray():Array
Returns an array containing all of the elements in this collection. | Collection |
indexOf | () | method |
public function indexOf(item:Object):int
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
Parameters
item:Object — the element to search for
|
int — the index of the first occurrence of the specified element in this list,
or -1 if this list does not contain the element
|
insert | () | method |
public function insert(item:Object, index:uint):void
Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
Parameters
item:Object — element to be inserted
| |
index:uint — index at which the specified element is to be inserted
|
removeAt | () | method |
public function removeAt(index:uint):void
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).
Parameters
index:uint — the index of the element to be removed
|
sort | () | method |
public function sort(comparisonFunction:Function = null, sortOptions:int = -1):void
Sorts the List by using a comparisionFunction.
Parameters
comparisonFunction:Function (default = null ) — A function used for comparison
| |
sortOptions:int (default = -1 ) — An optional option parameter
|