|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.util.extractor.AbstractExtractor
public abstract class AbstractExtractor
Abstract base for ValueExtractor implementations. It provides common functionality that allows any extending extractor to be used as a value Comparator.
ChainedComparator
,
InverseComparator
Constructor Summary | |
---|---|
AbstractExtractor()
|
Method Summary | |
---|---|
int |
compare(Object o1,
Object o2)
Compares its two arguments for order. |
int |
compareEntries(QueryMap.Entry entry1,
QueryMap.Entry entry2)
Compare two entries based on the rules specified by Comparator . |
abstract Object |
extract(Object oTarget)
Extract the value from the passed object. |
Methods inherited from interface com.tangosol.util.ValueExtractor |
---|
equals, hashCode, toString |
Methods inherited from interface java.util.Comparator |
---|
equals |
Constructor Detail |
---|
public AbstractExtractor()
Method Detail |
---|
public abstract Object extract(Object oTarget)
extract
in interface ValueExtractor
oTarget
- an Object to retrieve the value from
public int compare(Object o1, Object o2)
compare
in interface Comparator
o1
- the first object to be comparedo2
- the second object to be compared
ClassCastException
- if the arguments' types prevent them from
being compared by this Comparator.public int compareEntries(QueryMap.Entry entry1, QueryMap.Entry entry2)
Comparator
.
If possible, use the 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.
compareEntries
in interface QueryMapComparator
entry1
- the first entry to compare values from; read-onlyentry2
- the second entry to compare values from; read-only
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |