Oracle Coherence for C++ API
Release 3.6.1.0
E18813-01

- Main Page
- Namespaces
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# QueryMapComparator Class Reference

`#include <coherence/util/comparator/QueryMapComparator.hpp>`

Inherits Comparator.

Inherited by ChainedComparator`[virtual]`, InverseComparator`[virtual]`, SafeComparator`[virtual]`, and AbstractExtractor`[virtual]`.

List of all members.

## Detailed Description

This interface is used by Comparator implementations that can use value extraction optimization exposed by the QueryMap::Entry interface.

Author:
  djl 2008.03.03

## Public Types
typedef spec::Handle | Handle
| QueryMapComparator Handle definition.
typedef spec::View | View
| QueryMapComparator View definition.
typedef spec::Holder | Holder
| QueryMapComparator Holder definition.
## Public Member Functions
virtual int32_t | compareEntries (QueryMap::Entry::View vEntry1, QueryMap::Entry::View vEntry2) const =0
| Compare two entries based on the rules specified by Comparator.

## Member Function Documentation

virtual int32_t compareEntries | ( | QueryMap::Entry::View | vEntry1,
|  | QueryMap::Entry::View | vEntry2 |
| ) |  |  | const`[pure virtual]`

Compare two entries based on the rules specified by Comparator.

If possible, use the coherence::util::QueryMap.Entry::extract() method to optimize the value extraction process.

This method is expected to be implemented by Comparator wrappers, such as ChainedComparator and InverseComparator, which simply pass on this invocation to the wrapped Comparator 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 ValueExtractor implementations that implement the Comparator interface. It is expected that in most cases, the Comparator wrappers will eventually terminate at (i.e. delegate to) ValueExtractors that also implement this interface.

Parameters:

  | vEntry1 | the first entry to compare values from; read-only
  | vEntry2 | the second entry to compare values from; read-only

Returns:
  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

Exceptions:

  | ClassCastException | if the arguments' types prevent them from being compared by this Comparator.
  | IllegalArgumentException | if the extractor cannot handle the passed objects for any other reason; an implementor should include a descriptive message

Implemented in ChainedComparator, InverseComparator, SafeComparator, AbstractExtractor, and MultiExtractor.

The documentation for this class was generated from the following file:

- coherence/util/comparator/QueryMapComparator.hpp

Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.