Packagecom.flexcalendar.components.calendar.core.dataModel
Classpublic class CalendarItemSetCache
InheritanceCalendarItemSetCache Inheritance Object

Keeps cache of items for specific CalendarItemSet in given period of time. It keeps cache timestamp so it can be determined if cache is stale or fresh.



Public Properties
 PropertyDefined By
  cachedItems : Array
CalendarItemSetCache
  cacheRange : DateRange
CalendarItemSetCache
  itemSet : ICalendarItemSet
CalendarItemSetCache
  requestTimestamp : Date
CalendarItemSetCache
Protected Properties
 PropertyDefined By
  _cachedItems : Array
CalendarItemSetCache
  _cacheRange : DateRange
CalendarItemSetCache
  _cacheTimestamp : Date
CalendarItemSetCache
  _itemSet : ICalendarItemSet
CalendarItemSetCache
  _ttl : Number
CalendarItemSetCache
Public Methods
 MethodDefined By
  
Creates cache of items for given calendarItem set in given period of time.
CalendarItemSetCache
  
Invalidates cache
CalendarItemSetCache
  
isCacheValid(timestamp:Date, dateRange:DateRange):Boolean
Checks whether cache is valid for given time and dareRange
CalendarItemSetCache
  
updateCache(cacheRange:DateRange, cacheTimestamp:Date, items:Array, ttl:Number):void
Updates CalendarItemSet cache with new values.
CalendarItemSetCache
Property Detail
_cachedItemsproperty
protected var _cachedItems:Array

_cacheRangeproperty 
protected var _cacheRange:DateRange

_cacheTimestampproperty 
protected var _cacheTimestamp:Date

_itemSetproperty 
protected var _itemSet:ICalendarItemSet

_ttlproperty 
protected var _ttl:Number

cachedItemsproperty 
cachedItems:Array


Implementation
    public function get cachedItems():Array
    public function set cachedItems(value:Array):void
cacheRangeproperty 
cacheRange:DateRange


Implementation
    public function get cacheRange():DateRange
    public function set cacheRange(value:DateRange):void
itemSetproperty 
itemSet:ICalendarItemSet


Implementation
    public function get itemSet():ICalendarItemSet
    public function set itemSet(value:ICalendarItemSet):void
requestTimestampproperty 
requestTimestamp:Date


Implementation
    public function get requestTimestamp():Date
    public function set requestTimestamp(value:Date):void
Constructor Detail
CalendarItemSetCache()Constructor
public function CalendarItemSetCache(itemSet:ICalendarItemSet, ttl:Number)

Creates cache of items for given calendarItem set in given period of time.

Parameters
itemSet:ICalendarItemSet — - item set which items are cached
 
ttl:Number (default = NaN) — - time in milliseconds which determines how long cache is valid for (default 5 min)
Method Detail
invalidateCache()method
public function invalidateCache():void

Invalidates cache

isCacheValid()method 
public function isCacheValid(timestamp:Date, dateRange:DateRange):Boolean

Checks whether cache is valid for given time and dareRange

Parameters

timestamp:Date — - verify if cache is valid for given timestamp
 
dateRange:DateRange — - verify if cache is valid for given dateRange

Returns
Boolean
updateCache()method 
public function updateCache(cacheRange:DateRange, cacheTimestamp:Date, items:Array, ttl:Number):void

Updates CalendarItemSet cache with new values.

Parameters

cacheRange:DateRange
 
cacheTimestamp:Date
 
items:Array
 
ttl:Number (default = NaN)