CoherenceTM v3.4.1
Copyright© 2000-2008 by Oracle Corporation

com.tangosol.util
Interface ValueExtractor

All Known Implementing Classes:
AbstractCompositeExtractor, AbstractExtractor, ChainedExtractor, ComparisonValueExtractor, EntryExtractor, IdentityExtractor, KeyExtractor, MultiExtractor, NullImplementation.NullValueExtractor, ReflectionExtractor

public interface ValueExtractor

ValueExtractor is used to both extract values (for example, for sorting or filtering) from an object, and to provide an identity for that extraction.

Important Note: all classes that implement ValueExtractor interface must explicitly implement the hashCode() and equals() methods in a way that is based solely on the object's serializable state.

Author:
cp/gg 2002.10.31

Method Summary
 boolean equals(java.lang.Object o)
          Compare the ValueExtractor with another object to determine equality.
 java.lang.Object extract(java.lang.Object oTarget)
          Extract the value from the passed object.
 int hashCode()
          Determine a hash value for the ValueExtractor object according to the general Object.hashCode() contract.
 java.lang.String toString()
          Provide a human-readable description of this ValueExtractor object.
 

Method Detail

extract

java.lang.Object extract(java.lang.Object oTarget)
Extract the value from the passed object. The returned value may be null. For intrinsic types, the returned value is expected to be a standard wrapper type in the same manner that reflection works; for example, int would be returned as a java.lang.Integer.

Parameters:
oTarget - an Object to retrieve the value from
Returns:
the extracted value as an Object; null is an acceptable value
Throws:
java.lang.ClassCastException - if this ValueExtractor is incompatible with the passed object to extract a value from and the implementation requires the passed object to be of a certain type
WrapperException - if this ValueExtractor encounters an exception in the course of extracting the value
java.lang.IllegalArgumentException - if this ValueExtractor cannot handle the passed object for any other reason; an implementor should include a descriptive message

equals

boolean equals(java.lang.Object o)
Compare the ValueExtractor with another object to determine equality. Two ValueExtractor objects, ve1 and ve2 are considered equal iff ve1.extract(o) equals ve2.extract(o) for all values of o.

Parameters:
o - the reference object with which to compare
Returns:
true iff this ValueExtractor and the passed object are equivalent ValueExtractors

hashCode

int hashCode()
Determine a hash value for the ValueExtractor object according to the general Object.hashCode() contract.

Returns:
an integer hash value for this ValueExtractor object

toString

java.lang.String toString()
Provide a human-readable description of this ValueExtractor object.

Returns:
a human-readable description of this ValueExtractor object

CoherenceTM v3.4.1
Copyright© 2000-2008 by Oracle Corporation