Package | com.yworks.support |
Class | public class ArrayList |
Inheritance | ArrayList flash.utils.Proxy |
Implements | List |
This class also lets you use [ ] array notation to access the getItemAt()
and setItemAt()
methods. The for each..in
loop is also supported.
Method | Defined By | ||
---|---|---|---|
Creates a new instance based on the given collection. | ArrayList | ||
Adds all of the elements in the specified collection to this collection (optional operation). | ArrayList | ||
addItem(item:Object):Boolean
Adds the specified item to this collection. | ArrayList | ||
clear():void
Removes all of the elements from this collection. | ArrayList | ||
contains(item:Object):Boolean
Returns true if the given item is contained in this
collection. | ArrayList | ||
getItemAt(index:int):Object
Returns the element at the specified position in this collection. | ArrayList | ||
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. | ArrayList | ||
insert(item:Object, index:uint):void
Inserts the specified element at the specified position in this list. | ArrayList | ||
isEmpty():Boolean | ArrayList | ||
Returns an iterator over a set of elements. | ArrayList | ||
length():uint
Returns the number of elements in this collection. | ArrayList | ||
removeAt(index:uint):void
Removes the element at the specified position in this list. | ArrayList | ||
removeItem(item:Object):Boolean
Removes a single instance of the specified element from this collection, if it is present (optional operation). | ArrayList | ||
sort(comparisonFunction:Function = null, sortOptions:int = -1):void
Sorts the List by using a comparisionFunction. | ArrayList | ||
toArray():Array
Copies the items of this List to an array and returns it. | ArrayList | ||
toString():String | ArrayList |
ArrayList | () | Constructor |
public function ArrayList(collection:Iterable = null)
Creates a new instance based on the given collection.
Parameterscollection:Iterable (default = null ) — A collection whose contents will be copied to the ArrayList.
|
addAll | () | method |
public function addAll(iter:Iterable):void
Adds all of the elements in the specified collection to this collection (optional operation).
Parameters
iter:Iterable — the collection containing elements to be added to this collection
|
addItem | () | method |
public function addItem(item:Object):Boolean
Adds the specified item to this collection. Returns true if this collection changed as a result of the call. (Returns false if this collection does not permit duplicates and already contains the specified element.)
Parameters
item:Object — element whose presence in this collection is to be ensured
|
Boolean — true if this collection changed as a result of the call
|
clear | () | method |
public function clear():void
Removes all of the elements from this collection. The collection will be empty after this method returns.
contains | () | method |
public function contains(item:Object):Boolean
Returns true if the given item is contained in this
collection. Note that the normal equality operator is
used to check whether the item is contained, i.e. this
method yields true
if item == otherItem
for one otherItem
in the collection.
Parameters
item:Object |
Boolean |
getItemAt | () | method |
public function getItemAt(index:int):Object
Returns the element at the specified position in this collection.
Parameters
index:int — the index of the element to return
|
Object — the element at the specified position in this list
|
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
|
isEmpty | () | method |
public function isEmpty():Boolean
ReturnsBoolean |
iterator | () | method |
public function iterator():Iterator
Returns an iterator over a set of elements.
ReturnsIterator — an Iterator.
|
length | () | method |
public function length():uint
Returns the number of elements in this collection.
Returnsuint — the number of elements in this collection
|
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
|
removeItem | () | method |
public function removeItem(item:Object):Boolean
Removes a single instance of the specified element from this collection, if it is present (optional operation).
Parameters
item:Object — element to be removed from this collection, if present
|
Boolean — true if an element was removed as a result of this call
|
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
|
toArray | () | method |
public function toArray():Array
Copies the items of this List to an array and returns it.
ReturnsArray |
toString | () | method |
public function toString():String
ReturnsString |