Class ComparisonFilter
IFilter which compares the result of a member invocation with a value.
Inheritance
Inherited Members
Namespace: Tangosol.Util.Filter
Assembly: Coherence.dll
Syntax
public abstract class ComparisonFilter : ExtractorFilter, IEntryFilter, IFilter, IPortableObject
Constructors
ComparisonFilter()
Default constructor.
Declaration
protected ComparisonFilter()
ComparisonFilter(string, object)
Construct a ComparisonFilter.
Declaration
protected ComparisonFilter(string member, object value)
Parameters
Type | Name | Description |
---|---|---|
string | member | The name of the member to invoke via reflection. |
object | value | The object to compare the result with. |
ComparisonFilter(IValueExtractor, object)
Construct a ComparisonFilter.
Declaration
protected ComparisonFilter(IValueExtractor extractor, object value)
Parameters
Type | Name | Description |
---|---|---|
IValueExtractor | extractor | The IValueExtractor to use by this filter. |
object | value | The object to compare the result with. |
Fields
m_value
The value to compare to.
Declaration
protected object m_value
Field Value
Type | Description |
---|---|
object |
Properties
Value
Gets the object to compare the extraction result with.
Declaration
public virtual object Value { get; }
Property Value
Type | Description |
---|---|
object | The object to compare the extraction result with. |
Methods
CalculateIteratorEffectiveness(int)
Helper method to calculate effectiveness (or rather ineffectiveness) of a simple iteration against a key set that has to be performed due to an absence of corresponding index.
Declaration
public static int CalculateIteratorEffectiveness(int cKeys)
Parameters
Type | Name | Description |
---|---|---|
int | cKeys | The number of keys to iterate through. |
Returns
Type | Description |
---|---|
int | The cost of the iteration. |
CalculateMatchEffectiveness(IDictionary, ICollection)
Helper method to calculate effectiveness for ComparisonFilters that need no more than a single index match in order to retrieve all necessary keys to perform the applyIndex() operation. Such filters are: Contains, Equals, NotEquals.
Declaration
protected int CalculateMatchEffectiveness(IDictionary indexes, ICollection keys)
Parameters
Type | Name | Description |
---|---|---|
IDictionary | indexes | The available MapIndex objects keyed by the related IValueExtractor; read-only |
ICollection | keys | The set of keys that will be filtered; read-only |
Returns
Type | Description |
---|---|
int | An effectiveness estimate of how well this filter can use the specified indexes to filter the specified keys |
CalculateRangeEffectiveness(IDictionary, ICollection)
Helper method to calculate effectiveness for ComparisonFilters that need a range of values from an index in order to retrieve all necessary keys to perform the applyIndex() operation. Such filters are: Less, LessEquals, Greater, GreaterEquals.
Declaration
protected int CalculateRangeEffectiveness(IDictionary indexes, ICollection keys)
Parameters
Type | Name | Description |
---|---|---|
IDictionary | indexes | The available MapIndex objects keyed by the related IValueExtractor; read-only |
ICollection | keys | The set of keys that will be filtered; read-only |
Returns
Type | Description |
---|---|
int | An effectiveness estimate of how well this filter can use the specified indexes to filter the specified keys |
Equals(object)
Compare the ComparisonFilter with another object to determine equality.
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
object | o | The ComparisonFilter to compare to. |
Returns
Type | Description |
---|---|
bool | true if this ComparisonFilter and the passed object are equivalent ComparisonFilter objects. |
Overrides
Remarks
Two ComparisonFilter objects are considered equal if they are of the same type and their Extractor and Value are equal.
GetHashCode()
Determine a hash value for the ComparisonFilter object according to the general object.GetHashCode() contract.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | An integer hash value for this ComparisonFilter object. |
Overrides
ReadExternal(IPofReader)
Restore the contents of a user type instance by reading its state using the specified IPofReader object.
Declaration
public override void ReadExternal(IPofReader reader)
Parameters
Type | Name | Description |
---|---|---|
IPofReader | reader | The IPofReader from which to read the object's state. |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |
ToString()
Return a human-readable description for this ComparisonFilter.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string description of the ComparisonFilter. |
Overrides
WriteExternal(IPofWriter)
Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.
Declaration
public override void WriteExternal(IPofWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IPofWriter | writer | The IPofWriter to which to write the object's state. |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |