Show / Hide Table of Contents

Class AbstractKeySetBasedCache

AbstractKeySetBasedCache is an extension to the AbstractKeyBasedCache that has a full awareness of the set of keys upon which the cache is based.

Inheritance
object
AbstractKeyBasedCache
AbstractKeySetBasedCache
ContinuousQueryCache
Implements
ICache
IDictionary
ICollection
IEnumerable
Inherited Members
AbstractKeyBasedCache.Entries
AbstractKeyBasedCache.IsSynchronized
AbstractKeyBasedCache.IsReadOnly
AbstractKeyBasedCache.IsFixedSize
AbstractKeyBasedCache.Keys
AbstractKeyBasedCache.SyncRoot
AbstractKeyBasedCache.Values
AbstractKeyBasedCache.this[object]
AbstractKeyBasedCache.Get(object)
AbstractKeyBasedCache.RemoveBlind(object)
AbstractKeyBasedCache.Add(object, object)
AbstractKeyBasedCache.CopyTo(Array, int)
AbstractKeyBasedCache.Clear()
AbstractKeyBasedCache.GetAll(ICollection)
AbstractKeyBasedCache.GetEnumerator()
AbstractKeyBasedCache.Insert(object, object)
AbstractKeyBasedCache.Insert(object, object, long)
AbstractKeyBasedCache.InsertAll(IDictionary)
AbstractKeyBasedCache.Remove(object)
AbstractKeyBasedCache.Equals(object)
AbstractKeyBasedCache.GetHashCode()
AbstractKeyBasedCache.ToString()
AbstractKeyBasedCache.InstantiateKeysCollection()
AbstractKeyBasedCache.InstantiateEntriesCollection()
AbstractKeyBasedCache.InstantiateValuesCollection()
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Tangosol.Net.Cache.Support
Assembly: Coherence.dll
Syntax
public abstract class AbstractKeySetBasedCache : AbstractKeyBasedCache, ICache, IDictionary, ICollection, IEnumerable
Remarks

As a result, it is possible to optimize the implementation of a number of methods that benefit from a knowledge of the entire set of keys.

Read-only implementations must implement GetInternalKeysCollection() and Get(object). Read/write implementations must additionally implement Insert(object, object, long) and Remove(object). If the implementation has any cost of returning an "old value", then the InsertAll(IDictionary) and RemoveBlind(object) methods should also be implemented. The only other obvious method for optimization is Clear(), if the implementation is able to do it in bulk.

Properties

Count

Returns the number of key-value mappings in this cache.

Declaration
public override int Count { get; }
Property Value
Type Description
int

The number of key-value mappings in this cache.

Overrides
AbstractKeyBasedCache.Count

Methods

Contains(object)

Returns true if this cache contains a mapping for the specified key.

Declaration
public override bool Contains(object key)
Parameters
Type Name Description
object key

Key whose mapping is searched for.

Returns
Type Description
bool

true if this cache contains a mapping for the specified key, false otherwise.

Overrides
AbstractKeyBasedCache.Contains(object)

GetInternalKeysCollection()

Obtain a collection of keys that are represented by this cache.

Declaration
protected abstract ICollection GetInternalKeysCollection()
Returns
Type Description
ICollection

An internal collection of keys that are contained by this cache.

Remarks

The AbstractKeySetBasedCache only utilizes the internal keys collection as a read-only resource.

GetKeysEnumerator()

Create an IEnumerator over the keys in this cache.

Declaration
protected override IEnumerator GetKeysEnumerator()
Returns
Type Description
IEnumerator

A new instance of an enumerator over the keys in this cache.

Overrides
AbstractKeyBasedCache.GetKeysEnumerator()
Remarks

Note that this implementation delegates back to the keys collection, while the super type delegates from the keys collection to this method.

InstantiateKeyEnumerator()

Factory pattern: Create an IEnumerator over the keys in the cache.

Declaration
protected virtual IEnumerator InstantiateKeyEnumerator()
Returns
Type Description
IEnumerator

A new instance of IEnumerator that iterates over the keys in the cache.

Implements

ICache
IDictionary
ICollection
IEnumerable
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.