| Package | system.data |
| Interface | public interface Collection extends Cloneable, Iterable, Serializable |
| Implementors | ArrayCollection, Batch, EventListenerBatch, TypedCollection |
A collection represents a group of objects, known as its elements.
Some collections allow duplicate elements and others do not. Some are ordered and others unordered.
| Method | Defined By | ||
|---|---|---|---|
add(o:*):Boolean
Ensures that this collection contains the specified element (optional operation). | Collection | ||
clear():void
Removes all of the elements from this collection (optional operation). | Collection | ||
![]() | clone():*
Creates and returns a shallow copy of the object. | Cloneable | |
contains(o:*):Boolean
Returns true if this collection contains the specified element. | Collection | ||
get(key:*):*
Returns the element from this collection at the passed index. | Collection | ||
indexOf(o:*, fromIndex:uint = 0):int
Returns the position of the passed object in the collection. | Collection | ||
isEmpty():Boolean
Returns true if this collection contains no elements. | Collection | ||
![]() |
Returns the iterator reference of the object. | Iterable | |
remove(o:*):*
Removes a single instance of the specified element from this collection, if it is present (optional operation). | Collection | ||
size():uint
Retrieves the number of elements in this collection. | Collection | ||
toArray():Array
Returns an array containing all of the elements in this collection. | Collection | ||
![]() | toSource(indent:int = 0):String
Returns the source code string representation of the object. | Serializable | |
| add | () | method |
public function add(o:*):BooleanEnsures that this collection contains the specified element (optional operation).
Parameters
o:* |
Boolean |
| clear | () | method |
public function clear():voidRemoves all of the elements from this collection (optional operation).
| contains | () | method |
public function contains(o:*):Boolean
Returns true if this collection contains the specified element.
Parameters
o:* |
Boolean — true if this collection contains the specified element.
|
| get | () | method |
public function get(key:*):*Returns the element from this collection at the passed index.
Parameters
key:* |
* — the element from this collection at the passed index.
|
| indexOf | () | method |
public function indexOf(o:*, fromIndex:uint = 0):intReturns the position of the passed object in the collection.
Parameters
o:* — the object to search in the collection.
| |
fromIndex:uint (default = 0) — the index to begin the search in the collection.
|
int — the index of the object or -1 if the object isn't find in the collection.
|
| isEmpty | () | method |
public function isEmpty():Boolean
Returns true if this collection contains no elements.
Boolean — true if this collection is empty else false.
|
| remove | () | method |
public function remove(o:*):*Removes a single instance of the specified element from this collection, if it is present (optional operation).
Parameters
o:* |
* |
| size | () | method |
public function size():uintRetrieves the number of elements in this collection.
Returnsuint — the number of elements in this collection.
|
| toArray | () | method |
public function toArray():ArrayReturns an array containing all of the elements in this collection.
ReturnsArray — an array containing all of the elements in this collection.
|