Packageorg.springextensions.actionscript.collections
Classpublic class EntityCollection
InheritanceEntityCollection Inheritance TypedCollection Inheritance mx.collections.ArrayCollection

Collection that is forced to hold instances of Entity No duplicate id's can be added to the collection.

Author: Cardoen Lieven
Version: $Revision: 21 $, $Date: 2008-11-01 22:58:42 +0100 (za, 01 nov 2008) $, $Author: dmurat $
Since: 0.1



Public Properties
 PropertyDefined by
 Inheritedtype : Class
TypedCollection
Public Methods
 MethodDefined by
  
EntityCollection(source:Array = null)
Constructor
EntityCollection
 Inherited
addItem(item:Object):void
TypedCollection
 Inherited
addItemAt(item:Object, index:int):void
TypedCollection
 Inherited
Registers an ITypedCollectionListener listener
TypedCollection
 Inherited
TypedCollection
  
containsId(id:int):Boolean
EntityCollection
  
Adds a range to the entityCollection.
EntityCollection
 Inherited
createCursor():IViewCursor
TypedCollection
  
EntityCollection
 Inherited
removeItem(item:Object):Boolean
Removes an item from the TypedCollection
TypedCollection
Protected Methods
 MethodDefined by
  
check(item:Object):void
Checks if the collection already holds an Entity instance with the same id as the passed Entity instance
EntityCollection
Constructor detail
EntityCollection()constructor
public function EntityCollection(source:Array = null)

Constructor

Parameters
source:Array (default = null) — TODO: Extra parameter with Class that should be a superclass of Entity
Method detail
check()method
protected override function check(item:Object):void

Checks if the collection already holds an Entity instance with the same id as the passed Entity instance

Parameters
item:Object — the object to be checked
containsId()method 
public function containsId(id:int):BooleanParameters
id:int

Returns
Boolean
copyFrom()method 
public function copyFrom(range:EntityCollection):void

Adds a range to the entityCollection. If an entity of the range exists in the entityCollection, then it is copied to the existing entity and the pointer to the entity is changed to the entity of the entityCollection. If it doesn't exist, it is added and the pointer stays.

Parameters
range:EntityCollection — The EntityCollection to be added
getEntityWithId()method 
public function getEntityWithId(id:int):EntityParameters
id:int

Returns
Entity