Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


com.tangosol.util.comparator
Interface QueryMapComparator

All Superinterfaces:
Comparator
All Known Implementing Classes:
AbstractCompositeExtractor, AbstractExtractor, ChainedComparator, ChainedExtractor, ComparisonValueExtractor, ConditionalExtractor, EntryComparator, EntryExtractor, IdentityExtractor, InverseComparator, KeyExtractor, MultiExtractor, PofExtractor, ReflectionExtractor, SafeComparator

public interface QueryMapComparator
extends Comparator

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

Author:
cp/gg 2002.12.13, 2006.06.12

Method Summary
 int compareEntries(QueryMap.Entry entry1, QueryMap.Entry entry2)
          Compare two entries based on the rules specified by Comparator.

 

Methods inherited from interface java.util.Comparator
compare, equals

 

Method Detail

compareEntries

int compareEntries(QueryMap.Entry entry1,
                   QueryMap.Entry entry2)
Compare two entries based on the rules specified by Comparator. <p/> If possible, use the extract method to optimize the value extraction process. <p/> 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. <p/> 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:
entry1 - the first entry to compare values from; read-only
entry2 - 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
Throws:
ClassCastException - if the arguments' types prevent them from being compared by this Comparator.
WrapperException - if the extractor encounters an exception in the course of extracting the value
IllegalArgumentException - if the extractor cannot handle the passed objects for any other reason; an implementor should include a descriptive message
Since:
Coherence 3.2

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


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