ICacheTable TKey  MembersNFX Class Library

[This is preliminary documentation and is subject to change.]

The ICacheTable TKey  type exposes the following members.
Methods

  NameDescription
Public methodContainsKey
Returns true if cache has object with the key, optionally filtering-out objects older than ageSec param if it is > zero. Returns false if there is no object with the specified key or it is older than ageSec limit.
Public methodGet
Gets cache object by key, optionally filtering-out objects older than ageSec param if it is > zero. Returns null if there is no object with the specified key or it is older than ageSec limit.
Public methodGetOrPut
Atomically tries to get object by key if it exists, otherwise calls a factory method under lock and puts the data with the specified parameters. 'newPutResult' returns the result of the put after factory method call. Keep in mind, that even if a factory method created a new object, there may be a case when the value could not be physically inserted in the cache because of a collision (data with higher priority occupies space and space is capped), so check for 'newPutResult' value which is null in case of getting an existing item. Returns object that was gotten or created anew
Public methodPurge
Removes all data from table
(Inherited from ICacheTable.)
Public methodPut
Puts an object identified by a key into cache returning the result of the put. For example, put may have added nothing if the table is capped and the space is occupied with data of higher priority
Public methodRejuvenate
Resets inetrnal object age returning true of object was found and rejuvenated
Public methodRemove
Removes data by key returning true if found and removed
Public methodSizeOfValue
Returns the size of stored object if cache has object with the key, optionally filtering-out objects older than ageSec param if it is > zero.
Back to Top
Properties

  NameDescription
Public propertyCache
References cache that this table is under
(Inherited from ICacheTable.)
Public propertyCapacity
Returns how many slots/entries allocated in a table
(Inherited from ICacheTable.)
Public propertyCount
Returns how many records are kept in a table
(Inherited from ICacheTable.)
Public propertyKeyComparer
Returns equality comparer for keys, or null to use default Equals
Public propertyLoadFactor
Returns the percentage of occupied table slots. When this number exceeds high-water-mark threshold the table is grown, otheriwse if the number falls below the low-water-mark level then the table is shrunk
(Inherited from ICacheTable.)
Public propertyName (Inherited from INamed.)
Public propertyOptions
Cache table options in effect
(Inherited from ICacheTable.)
Back to Top
See Also