Interface ICacheIndex
ICacheIndex is used to correlate values stored in an indexed ICache (or attributes of those values) to the corresponding keys in the indexed ICache.
Namespace: Tangosol.Net.Cache
Assembly: Coherence.dll
Syntax
public interface ICacheIndex
Properties
Comparer
The IComparer used to sort the index.
Declaration
IComparer Comparer { get; }
Property Value
Type | Description |
---|---|
IComparer |
IndexContents
Get the IDictionary that contains the index contents.
Declaration
IDictionary IndexContents { get; }
Property Value
Type | Description |
---|---|
IDictionary |
Remarks
The keys of the IDictionary are the return values from the IValueExtractor operating against the indexed ICache's values, and for each key, the corresponding value stored in the IDictionary is an ICollection of keys to the indexed value.
If the ICacheIndex is known to be ordered, then the returned IDictionary object will be an instance of SortedList (or wrapper thereof). The SortedList may or may not have an IComparer object associated with it.
A client should assume that the returned IDictionary object is read-only and must not attempt to modify it.
IsOrdered
Determine if the ICacheIndex orders the contents of the indexed information.
Declaration
bool IsOrdered { get; }
Property Value
Type | Description |
---|---|
bool |
IsPartial
Determine if indexed information for any entry in the indexed ICache has been excluded from this index. This information is used by IIndexAwareFilter implementations to determine the most optimal way to apply the index.
Declaration
bool IsPartial { get; }
Property Value
Type | Description |
---|---|
bool | true if any entry of the indexed ICache has been excluded from the index, false otherwise |
ValueExtractor
Obtain the IValueExtractor object that the ICacheIndex uses to
extract an indexable Object from a value stored in the indexed
ICache. This property is never null
.
Declaration
IValueExtractor ValueExtractor { get; }
Property Value
Type | Description |
---|---|
IValueExtractor |
Methods
Delete(ICacheEntry)
Update this index in response to a remove operation on a cache.
Declaration
void Delete(ICacheEntry entry)
Parameters
Type | Name | Description |
---|---|---|
ICacheEntry | entry | The entry representing the object being removed. |
Get(object)
Using the index information if possible, get the value associated with the specified key. This is expected to be more efficient than using the IValueExtractor against an object containing the value, because the index should already have the necessary information at hand.
Declaration
object Get(object key)
Parameters
Type | Name | Description |
---|---|---|
object | key | The key that specifies the object to extract the value from. |
Returns
Type | Description |
---|---|
object | The value that would be extracted by this ICacheIndex's IValueExtractor from the object specified by the passed key; NO_VALUE if the index does not have the necessary information. |
Insert(ICacheEntry)
Update this index in response to a insert operation on a cache.
Declaration
void Insert(ICacheEntry entry)
Parameters
Type | Name | Description |
---|---|---|
ICacheEntry | entry | The entry representing the object being inserted. |
Update(ICacheEntry)
Update this index in response to a update operation on a cache.
Declaration
void Update(ICacheEntry entry)
Parameters
Type | Name | Description |
---|---|---|
ICacheEntry | entry | The entry representing the object being updated. |