Packageorg.springextensions.actionscript.domain.util
SVN browsingEntityUtil.as
FisheyeEntityUtil.as
Classpublic final class EntityUtil

Provides utilities for working with IEntity implementations and collections holding IEntity implementations.



Public Methods
 MethodDefined by
  
containsEntityWithID(entities:Array, id:Object):Boolean
[static]
EntityUtil
  
containsEntityWithSamePropertyValue(entities:ArrayCollection, entity:Object, prop:String):Boolean
[static]
EntityUtil
  
getEntitiesByID(entities:Array, id:Object):Array
[static]
EntityUtil
  
getEntityByID(entities:Array, id:Object):*
[static] Returns the first entity in the given array that has the given id.
EntityUtil
  
getEntityByProperty(entities:Array, propertyName:String, propertyValue:Object):*
[static]
EntityUtil
  
getEntityByTypeAndID(entities:Array, type:Class, id:Object):IEntity
[static] Returns the first entity in the given array that has the given type and id.
EntityUtil
  
getEntityIndexByID(entities:Array, id:Object):int
[static] Returns the index of an entity in the given array based on its id.
EntityUtil
  
getIDs(entities:Array):Array
[static] Returns all ids of the given entities.
EntityUtil
  
getUniqueEntitiesUsingID(entities:Array):Array
[static] Returns an array of unique entities based on their id.
EntityUtil
  
removeEntityByID(entities:ICollectionView, id:*):IEntity
[static]
EntityUtil
Method detail
containsEntityWithID()method
public static function containsEntityWithID(entities:Array, id:Object):Boolean

Parameters
entities:Array
 
id:Object

Returns
Boolean
containsEntityWithSamePropertyValue()method 
public static function containsEntityWithSamePropertyValue(entities:ArrayCollection, entity:Object, prop:String):Boolean

Parameters
entities:ArrayCollection
 
entity:Object
 
prop:String

Returns
Boolean
getEntitiesByID()method 
public static function getEntitiesByID(entities:Array, id:Object):Array

Parameters
entities:Array
 
id:Object

Returns
Array
getEntityByID()method 
public static function getEntityByID(entities:Array, id:Object):*

Returns the first entity in the given array that has the given id. If none was found, null is returned.

Parameters
entities:Array
 
id:Object

Returns
*
getEntityByProperty()method 
public static function getEntityByProperty(entities:Array, propertyName:String, propertyValue:Object):*

Parameters
entities:Array
 
propertyName:String
 
propertyValue:Object

Returns
*
getEntityByTypeAndID()method 
public static function getEntityByTypeAndID(entities:Array, type:Class, id:Object):IEntity

Returns the first entity in the given array that has the given type and id. If none was found, null is returned.

Parameters
entities:Array
 
type:Class
 
id:Object

Returns
IEntity
getEntityIndexByID()method 
public static function getEntityIndexByID(entities:Array, id:Object):int

Returns the index of an entity in the given array based on its id. If no entity was found, -1 is returned.

Parameters
entities:Array — the array of IEntity instances
 
id:Object — the id of the entity

Returns
int — the index of the entity in the array or -1 if it was not found
getIDs()method 
public static function getIDs(entities:Array):Array

Returns all ids of the given entities.

Parameters
entities:Array

Returns
Array — an array containing all ids of the given entities
getUniqueEntitiesUsingID()method 
public static function getUniqueEntitiesUsingID(entities:Array):Array

Returns an array of unique entities based on their id.

Parameters
entities:Array

Returns
Array
removeEntityByID()method 
public static function removeEntityByID(entities:ICollectionView, id:*):IEntity

Parameters
entities:ICollectionView
 
id:*

Returns
IEntity