Packagecom.whirled.contrib.cache
Classpublic class LeastRecentlyUsedCache
ImplementsCache



Public Properties
 PropertyDefined by
  cacheStats : CacheStats
[read-only]
LeastRecentlyUsedCache
Protected Properties
 PropertyDefined by
  _cacheNames : Array
LeastRecentlyUsedCache
  _cacheValues : Dictionary
LeastRecentlyUsedCache
  _evaluator : CacheObjectEvaluator
LeastRecentlyUsedCache
  _lastEvaluationTotal : int
LeastRecentlyUsedCache
  _maxValue : int
LeastRecentlyUsedCache
  _missSource : DataSource
LeastRecentlyUsedCache
  _stats : CacheStats
LeastRecentlyUsedCache
  _timer : Timer
LeastRecentlyUsedCache
Public Methods
 MethodDefined by
  
LeastRecentlyUsedCache(cacheMissSource:DataSource, maxValue:int = 1000, evaluator:CacheObjectEvaluator = null, evaluationTime:int = 1000)
LeastRecentlyUsedCache
  
getObject(name:String):Object
LeastRecentlyUsedCache
Protected Methods
 MethodDefined by
  
evaluateCache(... ignored):void
LeastRecentlyUsedCache
Property detail
_cacheNamesproperty
protected var _cacheNames:Array
cacheStatsproperty 
cacheStats:CacheStats  [read-only]Implementation
    public function get cacheStats():CacheStats
_cacheValuesproperty 
protected var _cacheValues:Dictionary
_evaluatorproperty 
protected var _evaluator:CacheObjectEvaluator
_lastEvaluationTotalproperty 
protected var _lastEvaluationTotal:int
_maxValueproperty 
protected var _maxValue:int
_missSourceproperty 
protected var _missSource:DataSource
_statsproperty 
protected var _stats:CacheStats
_timerproperty 
protected var _timer:Timer
Constructor detail
LeastRecentlyUsedCache()constructor
public function LeastRecentlyUsedCache(cacheMissSource:DataSource, maxValue:int = 1000, evaluator:CacheObjectEvaluator = null, evaluationTime:int = 1000)

Parameters
cacheMissSource:DataSource — When the data is not found in the cache, it will be requested from this DataSource.
 
maxValue:int (default = 1000) — This maximum value of the objects in the cache. If this value is exceeded, the oldest values in the cache will be removed.
 
evaluator:CacheObjectEvaluator (default = null) — If no evaluator is provided, an ObjectCountEvaluator will be used, causing this cache to store maxValue objects before it starts to purge old entries
 
evaluationTime:int (default = 1000) — The minimum amount of time that must pass between cache evaluations in milliseconds.
Method detail
evaluateCache()method
protected function evaluateCache(... ignored):voidParameters
... ignored
getObject()method 
public function getObject(name:String):ObjectParameters
name:String

Returns
Object