Get the values for all the specified keys, if they are in the cache.

Namespace: Tangosol.Net.Cache
Assembly: Coherence (in Coherence.dll) Version: 12.1.2.0 (12.1.2.0)

Syntax

C#
public override IDictionary GetAll(
	ICollection keys
)

Parameters

keys
Type: System.Collections..::..ICollection
A collection of keys that may be in the named cache.

Return Value

A dictionary of keys to values for the specified keys passed in keys.

Implements

ICache..::..GetAll(ICollection)
ICache..::..GetAll(ICollection)

Remarks

For each key that is in the cache, that key and its corresponding value will be placed in the dictionary that is returned by this method. The absence of a key in the returned dictionary indicates that it was not in the cache, which may imply (for caches that can load behind the scenes) that the requested data could not be loaded.

The result of this method is defined to be semantically the same as the following implementation, without regards to threading issues:

            IDictionary dict = new AnyDictionary();
            // could be a Hashtable (but does not have to)
            foreach (object key in colKeys)
            {
                object value = this[key];
                if (value != null || Contains(key))
                {
                    dict[key] = value;
                }
            }
            return dict;
            

See Also