|
Oracle® Coherence Java API Reference Release 3.7.0.0 E18683-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
com.tangosol.util.extractor.PofExtractor
public class PofExtractor
POF-based ValueExtractor implementation. PofExtractor takes advantage of POF's indexed state to extract part of an object without needing to deserialize the entire object.
POF uses a compact form in the serialized value when possible. For example, some numeric values are represented as special POF intrinsic types in which the type implies the value. As a result, POF requires the receiver of a value to have implicit knowledge of the type. PofExtractor uses the class supplied in the constructor as the source of the type information. If the class is null, PofExtractor will infer the type from the serialized state.
Example where extracted value is double:
PofExtractor extractor = new PofExtractor(double.class, 3);
Example where extracted value should be inferred:
PofExtractor extractor = new PofExtractor(null, 4);
Field Summary |
---|
Fields inherited from class com.tangosol.util.extractor.AbstractExtractor |
---|
KEY, m_nTarget, VALUE |
Constructor Summary | |
---|---|
PofExtractor() Default constructor (necessary for the PortableObject interface). |
|
PofExtractor(java.lang.Class clz, int iProp) Constructs a PofExtractor based on a property index. |
|
PofExtractor(java.lang.Class clz, PofNavigator navigator) Constructs a PofExtractor based on a POF navigator. |
|
PofExtractor(java.lang.Class clz, PofNavigator navigator, int nTarget) Constructs a PofExtractor based on a POF navigator and the entry extraction target. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o) Compare the PofExtractor with another object to determine equality. |
java.lang.Object |
extractFromEntry(java.util.Map.Entry entry) Extracts 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. |
java.lang.Class |
getClassExtracted() Obtain the Class of the extracted value. |
PofNavigator |
getNavigator() Obtain the POF navigator for this extractor. |
protected int |
getPofTypeId(PofContext ctx) Compute the expected pof type id based on the class. |
int |
hashCode() Determine a hash value for the PofExtractor object according to the general Object.hashCode() contract. |
void |
readExternal(PofReader in) Restore the contents of a user type instance by reading its state using the specified PofReader object. |
java.lang.String |
toString() Return a human-readable description for this PofExtractor. |
void |
writeExternal(PofWriter out) Save the contents of a POF user type instance by writing its state using the specified PofWriter object. |
Methods inherited from class com.tangosol.util.extractor.AbstractExtractor |
---|
compare, compareEntries, extract |
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 |
Constructor Detail |
---|
public PofExtractor()
public PofExtractor(java.lang.Class clz, int iProp)
This constructor is equivalent to:
PofExtractor extractor = new PofExtractor(clz, new SimplePofPath(iProp), VALUE);
clz
- the required class of the extracted value or null if the class is to be inferred from the serialized stateiProp
- property indexpublic PofExtractor(java.lang.Class clz, PofNavigator navigator)
This constructor is equivalent to:
PofExtractor extractor = new PofExtractor(clz, navigator, VALUE);
clz
- the required class of the extracted value or null if the class is to be inferred from the serialized statenavigator
- POF navigatorpublic PofExtractor(java.lang.Class clz, PofNavigator navigator, int nTarget)
clz
- the required class of the extracted value or null if the class is to be inferred from the serialized statenavigator
- POF navigatornTarget
- one of the AbstractExtractor.VALUE
or AbstractExtractor.KEY
valuesMethod Detail |
---|
public java.lang.Object extractFromEntry(java.util.Map.Entry entry)
It is expected that this extractor will only be used against POF-encoded entries implementing BinaryEntry
interface.
extractFromEntry
in class AbstractExtractor
entry
- an Entry object to extract a value fromjava.lang.UnsupportedOperationException
- if the specified Entry is not a POF-encoded BinaryEntry
or the serializer is not a PofContextjava.lang.ClassCastException
- if the extracted value is incompatible with the specified classpublic java.lang.Object extractOriginalFromEntry(MapTrigger.Entry entry)
AbstractExtractor
AbstractExtractor.extractFromEntry(java.util.Map.Entry)
method.extractOriginalFromEntry
in class AbstractExtractor
entry
- an Entry object whose original value should be used to extract the desired value frompublic PofNavigator getNavigator()
public java.lang.Class getClassExtracted()
public boolean equals(java.lang.Object o)
equals
in interface ValueExtractor
equals
in interface java.util.Comparator
o
- the reference object with which to compareObject.equals(java.lang.Object)
, Object.hashCode()
public int hashCode()
Object.hashCode()
contract.hashCode
in interface ValueExtractor
public java.lang.String toString()
toString
in interface ValueExtractor
public void readExternal(PofReader in) throws java.io.IOException
readExternal
in interface PortableObject
in
- the PofReader from which to read the object's statejava.io.IOException
- if an I/O error occurspublic void writeExternal(PofWriter out) throws java.io.IOException
writeExternal
in interface PortableObject
out
- the PofWriter to which to write the object's statejava.io.IOException
- if an I/O error occursprotected int getPofTypeId(PofContext ctx)
ctx
- pof context
|
Oracle® Coherence Java API Reference Release 3.7.0.0 E18683-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |