Packageorg.igniterealtime.xiff.collections
Classpublic class ArrayCollection
InheritanceArrayCollection Inheritance flash.utils.Proxy
ImplementsICollection
SubclassesRoom, Roster

The ArrayCollection class is a wrapper class that exposes an Array as a collection that can be accessed and manipulated using collection methods.



Public Properties
 PropertyDefined by
  length : int
[read-only] The number of items in the ArrayCollection.
ArrayCollection
  source : Array
The source of data in the ArrayCollection.
ArrayCollection
Protected Properties
 PropertyDefined by
  eventDispatcher : EventDispatcher
ArrayCollection
  _source : Array
ArrayCollection
Public Methods
 MethodDefined by
  
ArrayCollection(source:Array = null)
Constructor.
ArrayCollection
  
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
ArrayCollection
  
addItem(item:*):void
Add the specified item to the end of the list.
ArrayCollection
  
addItemAt(item:*, index:int):void
Add the specified item at the specified index.
ArrayCollection
  
clearSource():void
Remove all items from the ArrayCollection without dispatching a RESET event.
ArrayCollection
  
contains(item:*):Boolean
Returns whether the ArrayCollection contains the specified item.
ArrayCollection
  
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
ArrayCollection
  
getItemAt(index:int):*
Get the item at the specified index.
ArrayCollection
  
getItemIndex(item:*):int
Get the index of the item if it is in the ArrayCollection such that getItemAt( index ) == item.
ArrayCollection
  
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
ArrayCollection
  
itemUpdated(item:*):void
Notifies the view that an item has been updated.
ArrayCollection
  
removeAll():void
Remove all items from the ArrayCollection.
ArrayCollection
  
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
ArrayCollection
  
removeItem(item:*):Boolean
Remove the specified item from this list, should it exist.
ArrayCollection
  
removeItemAt(index:int):*
Removes the item at the specified index and returns it.
ArrayCollection
  
setItemAt(item:*, index:int):*
Places the item at the specified index.
ArrayCollection
  
toArray():Array
Return an Array that is populated in the same order as the ArrayCollection.
ArrayCollection
  
toString():String
Pretty prints the contents of the ArrayCollection to a string and returns it.
ArrayCollection
  
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
ArrayCollection
Protected Methods
 MethodDefined by
  
internalDispatchEvent(kind:String, item:int = null, location:* = -1):void
Dispatches a collection event with the specified information.
ArrayCollection
Protected Constants
 ConstantDefined by
  OUT_OF_BOUNDS_MESSAGE : String = "The supplied index is out of bounds."
ArrayCollection
Property detail
eventDispatcherproperty
protected var eventDispatcher:EventDispatcher
lengthproperty 
length:int  [read-only]

The number of items in the ArrayCollection.

Implementation
    public function get length():int
_sourceproperty 
protected var _source:Array
sourceproperty 
source:Array  [read-write]

The source of data in the ArrayCollection.

Implementation
    public function get source():Array
    public function set source(value:Array):void
Constructor detail
ArrayCollection()constructor
public function ArrayCollection(source:Array = null)

Constructor.

Parameters
source:Array (default = null)
Method detail
addEventListener()method
public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void

Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.

Parameters
type:String
 
listener:Function
 
useCapture:Boolean (default = false)
 
priority:int (default = 0)
 
useWeakReference:Boolean (default = false)
addItem()method 
public function addItem(item:*):void

Add the specified item to the end of the list. Equivalent to addItemAt( item, length );

Parameters
item:*
addItemAt()method 
public function addItemAt(item:*, index:int):void

Add the specified item at the specified index. Any item that was after this index is moved out by one.

Parameters
item:*
 
index:int
clearSource()method 
public function clearSource():void

Remove all items from the ArrayCollection without dispatching a RESET event.

contains()method 
public function contains(item:*):Boolean

Returns whether the ArrayCollection contains the specified item.

Parameters
item:*

Returns
Boolean
dispatchEvent()method 
public function dispatchEvent(event:Event):Boolean

Dispatches an event into the event flow.

Parameters
event:Event

Returns
Boolean
getItemAt()method 
public function getItemAt(index:int):*

Get the item at the specified index.

Parameters
index:int

Returns
*
getItemIndex()method 
public function getItemIndex(item:*):int

Get the index of the item if it is in the ArrayCollection such that getItemAt( index ) == item.

Parameters
item:*

Returns
int
hasEventListener()method 
public function hasEventListener(type:String):Boolean

Checks whether the EventDispatcher object has any listeners registered for a specific type of event.

Parameters
type:String

Returns
Boolean
internalDispatchEvent()method 
protected function internalDispatchEvent(kind:String, item:int = null, location:* = -1):void

Dispatches a collection event with the specified information.

Parameters
kind:String
 
item:int (default = null)
 
location:* (default = -1)
itemUpdated()method 
public function itemUpdated(item:*):void

Notifies the view that an item has been updated.

Parameters
item:*
removeAll()method 
public function removeAll():void

Remove all items from the ArrayCollection.

removeEventListener()method 
public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void

Removes a listener from the EventDispatcher object.

Parameters
type:String
 
listener:Function
 
useCapture:Boolean (default = false)
removeItem()method 
public function removeItem(item:*):Boolean

Remove the specified item from this list, should it exist.

Parameters
item:*

Returns
Boolean
removeItemAt()method 
public function removeItemAt(index:int):*

Removes the item at the specified index and returns it. Any items that were after this index are now one index earlier.

Parameters
index:int

Returns
*
setItemAt()method 
public function setItemAt(item:*, index:int):*

Places the item at the specified index. If an item was already at that index the new item will replace it and it will be returned.

Parameters
item:*
 
index:int

Returns
*
toArray()method 
public function toArray():Array

Return an Array that is populated in the same order as the ArrayCollection.

Returns
Array
toString()method 
public function toString():String

Pretty prints the contents of the ArrayCollection to a string and returns it.

Returns
String
willTrigger()method 
public function willTrigger(type:String):Boolean

Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.

Parameters
type:String

Returns
Boolean
Constant detail
OUT_OF_BOUNDS_MESSAGEconstant
protected const OUT_OF_BOUNDS_MESSAGE:String = "The supplied index is out of bounds."