CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.util.filter
Class ValueChangeEventFilter

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.BitHelper
          extended by com.tangosol.util.ExternalizableHelper
              extended by com.tangosol.util.filter.ExtractorFilter
                  extended by com.tangosol.util.filter.ValueChangeEventFilter
All Implemented Interfaces:
ExternalizableLite, PortableObject, Filter, EntryFilter, Serializable

public class ValueChangeEventFilter
extends ExtractorFilter
implements Filter

Filter which evaluates the content of a MapEvent values based on the specified value extractor. This filter evaluates to true only for update events that change the value of an extracted attribute.

Example: a filter that evaluates to true if there is an update to an Employee object that changes a value of the LastName property.

   new ValueChangeEventFilter("LastName");
 

Since:
Coherence 2.3
Author:
gg 2003.09.30
See Also:
MapEventFilter

Field Summary
 
Fields inherited from class com.tangosol.util.filter.ExtractorFilter
EVAL_COST, m_extractor
 
Constructor Summary
ValueChangeEventFilter()
          Default constructor (necessary for the ExternalizableLite interface).
ValueChangeEventFilter(String sMethod)
          Construct a ValueChangeEventFilter that evaluates MapEvent values based on the specified method name.
ValueChangeEventFilter(ValueExtractor extractor)
          Construct a ValueChangeEventFilter that evaluates MapEvent values based on the specified extractor.
 
Method Summary
 boolean equals(Object o)
          Compare the ValueChangeEventFilter with another object to determine equality.
 boolean evaluate(Object o)
          Apply the test to the object.
protected  boolean evaluateExtracted(Object oExtracted)
          Evaluate the specified extracted value.
 int hashCode()
          Determine a hash value for the ValueChangeEventFilter object according to the general Object.hashCode() contract.
 String toString()
          Return a human-readable description for this Filter.
 
Methods inherited from class com.tangosol.util.filter.ExtractorFilter
evaluateEntry, extract, getValueExtractor, readExternal, readExternal, writeExternal, writeExternal
 
Methods inherited from class com.tangosol.util.BitHelper
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, toBitString, toBitString, toBitString
 

Constructor Detail

ValueChangeEventFilter

public ValueChangeEventFilter()
Default constructor (necessary for the ExternalizableLite interface).


ValueChangeEventFilter

public ValueChangeEventFilter(ValueExtractor extractor)
Construct a ValueChangeEventFilter that evaluates MapEvent values based on the specified extractor.

Parameters:
extractor - ValueExtractor to extract MapEvent values

ValueChangeEventFilter

public ValueChangeEventFilter(String sMethod)
Construct a ValueChangeEventFilter that evaluates MapEvent values based on the specified method name.

Parameters:
sMethod - the name of the method to invoke via reflection
Method Detail

evaluate

public boolean evaluate(Object o)
Apply the test to the object.

Specified by:
evaluate in interface Filter
Overrides:
evaluate in class ExtractorFilter
Returns:
true if the test passes, false otherwise

evaluateExtracted

protected boolean evaluateExtracted(Object oExtracted)
Evaluate the specified extracted value.

Specified by:
evaluateExtracted in class ExtractorFilter
Parameters:
oExtracted - an extracted value to evaluate

equals

public boolean equals(Object o)
Compare the ValueChangeEventFilter with another object to determine equality.

Returns:
true iff this ValueChangeEventFilter and the passed object are equivalent filters

hashCode

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

Returns:
an integer hash value for this ValueChangeEventFilter object

toString

public String toString()
Return a human-readable description for this Filter.

Returns:
a String description of the Filter

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation