Packagesystem.data
Interfacepublic interface Collection extends Cloneable, Iterable, Serializable
Implementors ArrayCollection, Batch, EventListenerBatch, TypedCollection

The root interface in the collection hierarchy.

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.



Public Methods
 MethodDefined 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
 Inherited
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
 Inherited
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
 Inherited
toSource(indent:int = 0):String
Returns the source code string representation of the object.
Serializable
Method Detail
add()method
public function add(o:*):Boolean

Ensures that this collection contains the specified element (optional operation).

Parameters

o:*

Returns
Boolean
clear()method 
public function clear():void

Removes 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:*

Returns
Booleantrue 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:*

Returns
* — the element from this collection at the passed index.
indexOf()method 
public function indexOf(o:*, fromIndex:uint = 0):int

Returns 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.

Returns
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.

Returns
Booleantrue 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:*

Returns
*
size()method 
public function size():uint

Retrieves the number of elements in this collection.

Returns
uint — the number of elements in this collection.
toArray()method 
public function toArray():Array

Returns an array containing all of the elements in this collection.

Returns
Array — an array containing all of the elements in this collection.