|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
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.
Starting with Coherence 3.5, when used to extract information that is coming from a Map, subclasses have the additional ability to operate against the Map.Entry instead of just the value. In other words, like the EntryExtractor
class, this allows an extractor implementation to extract a desired value using all available information on the corresponding Map.Entry object and is intended to be used in advanced custom scenarios, when application code needs to look at both key and value at the same time or can make some very specific assumptions regarding to the implementation details of the underlying Entry object. To maintain full backwards compatibility, the default behavior remains to extract from the Value property of the Map.Entry.
Note: subclasses are responsible for initialization and POF and/or Lite serialization of the m_nTarget
field.
Field Summary | |
---|---|
static int |
KEY Indicates that the extractFromEntry(java.util.Map.Entry) operation should use the Entry's key. |
protected int |
m_nTarget Specifies which part of the entry should be used by the extractFromEntry(java.util.Map.Entry) operation. |
static int |
VALUE Indicates that the extractFromEntry(java.util.Map.Entry) operation should use the Entry's value. |
Constructor Summary | |
---|---|
AbstractExtractor() |
Method Summary | |
---|---|
int |
compare(java.lang.Object o1, java.lang.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 . |
java.lang.Object |
extract(java.lang.Object oTarget) Extract the value from the passed object. |
java.lang.Object |
extractFromEntry(java.util.Map.Entry entry) Extract the value from the passed Entry object. |
java.lang.Object |
extractOriginalFromEntry(MapTrigger.Entry entry) Extract the value from the "original value" of the passed Entry object. |
Methods inherited from class com.tangosol.util.BitHelper |
---|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString, toBytes, toBytes, toBytes, toBytes, toInt, toInt, toLong, toLong |
Methods inherited from interface com.tangosol.util.ValueExtractor |
---|
equals, hashCode, toString |
Methods inherited from interface java.util.Comparator |
---|
equals |
Field Detail |
---|
public static final int VALUE
extractFromEntry(java.util.Map.Entry)
operation should use the Entry's value.
public static final int KEY
extractFromEntry(java.util.Map.Entry)
operation should use the Entry's key.
protected int m_nTarget
extractFromEntry(java.util.Map.Entry)
operation. Legal values are VALUE
(default) or KEY
.
Note: subclasses are responsible for initialization and POF and/or Lite serialization of this field.
Constructor Detail |
---|
public AbstractExtractor()
Method Detail |
---|
public java.lang.Object extract(java.lang.Object oTarget)
extract
in interface ValueExtractor
oTarget
- an Object to retrieve the value frompublic int compare(java.lang.Object o1, java.lang.Object o2)
compare
in interface java.util.Comparator
o1
- the first object to be comparedo2
- the second object to be comparedjava.lang.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-onlypublic java.lang.Object extractFromEntry(java.util.Map.Entry entry)
extract(java.lang.Object)
method. By overriding this method, an extractor implementation is able to extract a desired value using all available information on the corresponding Map.Entry object and is intended to be used in advanced custom scenarios, when application code needs to look at both key and value at the same time or can make some very specific assumptions regarding to the implementation details of the underlying Entry object.entry
- an Entry object to extract a desired value frompublic java.lang.Object extractOriginalFromEntry(MapTrigger.Entry entry)
extractFromEntry(java.util.Map.Entry)
method.entry
- an Entry object whose original value should be used to extract the desired value from
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |