Cache K, V  ClassNReco.Recommender Class Library
An efficient Map-like class which caches values for keys. Values are not "put" into a [!:Cache]; instead the caller supplies the instance with an implementation of [!:IRetriever] which can load the value for a given key.

The cache does not support

keys.

Inheritance Hierarchy

System Object
  NReco.CF.Taste.Impl.Common Cache K, V 

Namespace: NReco.CF.Taste.Impl.Common
Assembly: NReco.Recommender (in NReco.Recommender.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public sealed class Cache<K, V> : IRetriever<K, V>
Type Parameters

K

[Missing <typeparam name="K"/> documentation for "T:NReco.CF.Taste.Impl.Common.Cache`2"]

V

[Missing <typeparam name="V"/> documentation for "T:NReco.CF.Taste.Impl.Common.Cache`2"]

The Cache K, V  type exposes the following members.

Constructors

  NameDescription
Public methodCache K, V (IRetriever K, V )
Creates a new cache based on the given [!:IRetriever].
Public methodCache K, V (IRetriever K, V , Int32)
Creates a new cache based on the given {@link Retriever} and with given maximum size.
Top
Methods

  NameDescription
Public methodClear
Clears the cache.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGet
Returns cached value for a key. If it does not exist, it is loaded using a {@link Retriever}.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodRemove
Uncaches any existing value for a given key.
Public methodRemoveKeysMatching
Clears all cache entries whose key matches the given predicate.
Public methodRemoveValueMatching
Clears all cache entries whose value matches the given predicate.
Public methodToString (Overrides Object ToString .)
Top
See Also