Packageverlocity.core
Classpublic dynamic class ObjectStorage
InheritanceObjectStorage Inheritance Object

Holds various objects in a key-string based memory storage.



Public Methods
 MethodDefined By
  
ObjectStorage(iMaxObjects:int = 0)
Creates a object storage which holds data accessed by string keys.
ObjectStorage
  
add(key:String, obj:Object):Object
Adds an object to the storage.
ObjectStorage
  
clear():void
Clears all data in the storage.
ObjectStorage
  
length(bCalc:Boolean = false):int
Returns the length of the storage.
ObjectStorage
  
remove(key:String):void
Removes an object from the storage.
ObjectStorage
  
retrieve(key:String):Object
Retrives an object from the store.
ObjectStorage
Constructor Detail
ObjectStorage()Constructor
public function ObjectStorage(iMaxObjects:int = 0)

Creates a object storage which holds data accessed by string keys.

Parameters
iMaxObjects:int (default = 0) — The maximum amount of objects allowed to store. 0 means no limit.
Method Detail
add()method
public function add(key:String, obj:Object):Object

Adds an object to the storage.

Parameters

key:String — The string key for object reference.
 
obj:Object — The object to store.

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

Clears all data in the storage.

length()method 
public function length(bCalc:Boolean = false):int

Returns the length of the storage.

Parameters

bCalc:Boolean (default = false) — Re-calculate the length? (can be taxing)

Returns
int
remove()method 
public function remove(key:String):void

Removes an object from the storage.

Parameters

key:String — The string key of the object.

retrieve()method 
public function retrieve(key:String):Object

Retrives an object from the store.

Parameters

key:String — The string key of the object.

Returns
Object