Packageorg.as3commons.reflect
Classpublic class TypeCache
InheritanceTypeCache Inheritance Object

A cache for storing key/value pairs in the form of FullyQualifiedName/Type.



Protected Properties
 PropertyDefined By
  cache : Dictionary
Object used to internally store FullyQualifiedName/Type key/value pairs.
TypeCache
Public Methods
 MethodDefined By
  
Constructor.
TypeCache
  
clear(applicationDomain:ApplicationDomain = null):void
Remove all entries from the cache.
TypeCache
  
contains(key:String, applicationDomain:ApplicationDomain):Boolean
Return true if the supplied key has a value in the cache.
TypeCache
  
get(key:String, applicationDomain:ApplicationDomain):Type
Retrieve a Type instance from the cache.
TypeCache
  
getKeys(applicationDomain:ApplicationDomain):Array
TypeCache
  
put(key:String, type:Type, applicationDomain:ApplicationDomain):void
Add a key/value pair to the cache.
TypeCache
  
size(applicationDomain:ApplicationDomain):int
Returns the size of the cache.
TypeCache
Property Detail
cacheproperty
protected var cache:Dictionary

Object used to internally store FullyQualifiedName/Type key/value pairs.

Constructor Detail
TypeCache()Constructor
public function TypeCache()

Constructor.

Method Detail
clear()method
public function clear(applicationDomain:ApplicationDomain = null):void

Remove all entries from the cache.

Parameters

applicationDomain:ApplicationDomain (default = null)

contains()method 
public function contains(key:String, applicationDomain:ApplicationDomain):Boolean

Return true if the supplied key has a value in the cache.

Parameters

key:String — The fully qualified name of the Type to lookup.
 
applicationDomain:ApplicationDomain

Returns
Boolean
get()method 
public function get(key:String, applicationDomain:ApplicationDomain):Type

Retrieve a Type instance from the cache.

Parameters

key:String — The fully qualified name of the Type to lookup.
 
applicationDomain:ApplicationDomain

Returns
Type — An instance of Type if one is present in the cache.
getKeys()method 
public function getKeys(applicationDomain:ApplicationDomain):Array

Parameters

applicationDomain:ApplicationDomain

Returns
Array — An Array of Strings representing the keys in the current TypeCache.
put()method 
public function put(key:String, type:Type, applicationDomain:ApplicationDomain):void

Add a key/value pair to the cache.

Parameters

key:String — The fully qualified name of the Type to lookup.
 
type:Type — The Type instance to store at key
 
applicationDomain:ApplicationDomain

size()method 
public function size(applicationDomain:ApplicationDomain):int

Returns the size of the cache. Cache size is determined by the number of keys in the cache.

Parameters

applicationDomain:ApplicationDomain

Returns
int