Show / Hide Table of Contents

Interface IQueryCacheComparer

This interface is used by IComparer implementations that can use value extraction optimization exposed by the IQueryCacheEntry.

Inherited Members
IComparer.Compare(object, object)
Namespace: Tangosol.Util.Comparator
Assembly: Coherence.dll
Syntax
public interface IQueryCacheComparer : IComparer

Methods

CompareEntries(IQueryCacheEntry, IQueryCacheEntry)

Compare two entries based on the rules specified by IComparer.

Declaration
int CompareEntries(IQueryCacheEntry entry1, IQueryCacheEntry entry2)
Parameters
Type Name Description
IQueryCacheEntry entry1

The first entry to compare values from; read-only.

IQueryCacheEntry entry2

The second entry to compare values from; read-only.

Returns
Type Description
int

A negative integer, zero, or a positive integer as the first entry denotes a value that is is less than, equal to, or greater than the value denoted by the second entry.

Remarks

If possible, use the Extract(IValueExtractor) method to optimize the value extraction process.

This method is expected to be implemented by IComparer wrappers, which simply pass on this invocation to the wrapped IComparer objects if they too implement this interface, or to invoke their default compare method passing the actual objects (not the extracted values) obtained from the extractor using the passed entries.

This interface is also expected to be implemented by IValueExtractor implementations that implement the IComparer interface. It is expected that in most cases, the IComparer wrappers will eventually terminate at (i.e. delegate to) IValueExtractors that also implement this interface.

Exceptions
Type Condition
InvalidCastException

If the arguments' types prevent them from being compared by this IComparer.

ArgumentException

If the extractor cannot handle the passed objects for any other reason; an implementor should include a descriptive message.

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