An array implementation of the Collection interface. Permits the insertion of undefined objects, allows duplicates and maintains the order of its elements. It implements all of the methods of the Collection interface as well as several convenience methods for accessing elements based on an index.
asdk.ArrayList
class
Method | Description |
addItem( item ) |
Adds the specified item to the ArrayList. |
addAll( object ) |
Adds all the elements within the array or collection object into the ArrayList. Returns true if the set is changed and false if the set is unchanged as a result of the call. |
clear() |
Removes all of the items from the ArrayList. |
containsItem( item ) |
A Boolean value indicating whether the specified item is stored in the ArrayList. |
containsAllItems( items : Collection ) |
A Boolean value indicating whether all the items within the specified Collection are stored in the ArrayList. |
getItemAt( index : Number ) |
Returns the item that is stored within the ArrayList at the specified index. |
getFirstIndexOf( element, index : Number ) |
Returns first index of the specified element in the ArrayList beginning at the specified index. |
getFirstItem() |
Returns first item in the ArrayList (the item at index 0). |
getLastIndexOf( element, index : Number ) |
Returns last index of the specified element in the ArrayList beginning at the specified index. |
getLastItem() |
Returns last item in the ArrayList (the item at index size - 1). |
getRange( startIndex : Number, endIndex : Number ) |
Returns the Collection of items within the specifed range including the item at startIndex and excluding the item at endIndex. |
getSize() |
Returns the total number of items stored within the ArrayList |
insertItemAt( index : Number, element ) |
Inserts the specified element into the ArrayList at the specified index. |
insertItemsAt( index : Number, collection : Collection ) |
Inserts the specified collection into the ArrayList beginning at the specified index. |
isEmpty() |
A Boolean value indicating whether the ArrayList is empty (true) or not (false). |
iterator() |
Returns an iterator that can traverse the items within the ArrayList |
removeAllItems( items : Collection ) |
Removes all the items within the collection object from the ArrayList. Returns true if the set is changed and false if the set is unchanged as a result of the call. |
removeItem( item ) |
Removes the specified item from the ArrayList. |
removeItemAt( index : Number ) |
Removes the item that is at the specified item from the ArrayList. |
removeRange( startIndex : Number, endIndex : Number ) |
Removes the Collection of items within the specifed range including the item at startIndex and excluding the item at endIndex. |
replaceItem( element, index : Number ) |
Replaces the item at the specified index within the ArrayList. |
retainAllItems( items : Collection ) |
Retains all the items within the collection object within the ArrayList and removes any items not in the collection. Returns true if the set is changed and false if the set is unchanged as a result of the call. |
setComparator( condition ) |
Sets the comparator for the ArrayList; this allows for customizing how objects are compared by using various
implementations of the asdk.condition.IComparator interface. The default comparator is asdk.condition.ObjectComparator . |
toArray() |
Returns the items within the ArrayList as an array. |
toString() |
Returns a string representation of the ArrayList. |