Packageorg.springextensions.actionscript.collections
SVN browsingEntityCollection.as
FisheyeEntityCollection.as
Classpublic class EntityCollection
InheritanceEntityCollection Inheritance TypedCollection Inheritance mx.collections.ArrayCollection

Collection that is forced to hold instances of type 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
All items added to the current TypedCollection instance must be of this type.
TypedCollection
Public Methods
 MethodDefined by
  
EntityCollection(source:Array = null)
Creates a new EntityCollection instance.
EntityCollection
 Inherited
addItem(item:Object):void
Checks if the specified Object is of the required type and if so adds it to the collection.
TypedCollection
 Inherited
addItemAt(item:Object, index:int):void
Checks if the specified Object is of the required type and if so adds it to the collection at the spcified index.
TypedCollection
 Inherited
Registers an ITypedCollectionListener listener
TypedCollection
 Inherited
Adds a list of items to the current TypedCollection by calling the addItem() method for every item in the specified list.
TypedCollection
  
containsId(id:int):Boolean
Determines whether the collection contains an Entity instance with the specified id.
EntityCollection
  
Adds a range to the current EntityCollection.
EntityCollection
 Inherited
createCursor():IViewCursor
TypedCollection
  
Retrieve the Entity instance with the specified id.
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
 Inherited
collectionChange_handler(event:CollectionEvent):void
Handles the COLLECTION_CHANGE event.
TypedCollection
 Inherited
TypedCollectionInit(type:Class, source:Array):void
Initializes the TypedCollectionInit instance.
TypedCollection
Constructor detail
EntityCollection()constructor
public function EntityCollection(source:Array = null)

Creates a new EntityCollection instance.

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

Throws
— if an Entity with the specified id exists in the current collection.
containsId()method 
public function containsId(id:int):Boolean

Determines whether the collection contains an Entity instance with the specified id.

Parameters
id:int — the specified id.

Returns
Boolean — True if the collection contains an Entity instance with the specified id.
copyFrom()method 
public function copyFrom(range:EntityCollection):void

Adds a range to the current 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):Entity

Retrieve the Entity instance with the specified id.

Parameters
id:int — The id of the required Entity instance.

Returns
Entity — The Entity instance with the specified id.

Throws
— if an Entity with the specified id wasn't found in the current collection.