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
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
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
Name | Description | |
---|---|---|
Cache K, V (IRetriever K, V ) |
Creates a new cache based on the given [!:IRetriever].
| |
Cache K, V (IRetriever K, V , Int32) |
Creates a new cache based on the given {@link Retriever} and with given maximum size.
|
Methods
Name | Description | |
---|---|---|
Clear |
Clears the cache.
| |
Equals | (Inherited from Object.) | |
Get |
Returns cached value for a key. If it does not exist, it is loaded using a {@link Retriever}.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Remove |
Uncaches any existing value for a given key.
| |
RemoveKeysMatching | Clears all cache entries whose key matches the given predicate. | |
RemoveValueMatching | Clears all cache entries whose value matches the given predicate. | |
ToString | (Overrides Object ToString .) |
See Also