Packagecom.yworks.support
Interfacepublic interface List extends Collection, Iterable
Implementors ArrayList, EmptyList, ReadOnlyList, SingletonList, YList



Public Methods
 MethodDefined By
 Inherited
addAll(iterable:Iterable):void
Adds all of the elements in the specified collection to this collection (optional operation).
Collection
 Inherited
addItem(item:Object):Boolean
Adds the specified item to this collection.
Collection
 Inherited
clear():void
Removes all of the elements from this collection.
Collection
 Inherited
contains(item:Object):Boolean
Returns true if this collection contains the specified element.
Collection
 Inherited
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
 Inherited
isEmpty():Boolean
Returns true if this collection contains no elements.
Collection
 Inherited
Returns an iterator over a set of elements.
Iterable
 Inherited
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
 Inherited
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
 Inherited
toArray():Array
Returns an array containing all of the elements in this collection.
Collection
Method Detail
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

Returns
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