#include <coherence/util/filter/ComparisonFilter.hpp>
Inherits ExtractorFilter.
Inherited by ContainsAllFilter, ContainsAnyFilter, ContainsFilter, EqualsFilter, GreaterEqualsFilter, GreaterFilter, InFilter, LessEqualsFilter, LessFilter, LikeFilter, and NotEqualsFilter.
Public Types | ||||
typedef spec::Handle | Handle | |||
ComparisonFilter Handle definition. | ||||
typedef spec::View | View | |||
ComparisonFilter View definition. | ||||
typedef spec::Holder | Holder | |||
ComparisonFilter Holder definition. | ||||
Public Member Functions | ||||
virtual void | readExternal (PofReader::Handle hIn) | |||
virtual void | writeExternal (PofWriter::Handle hOut) const | |||
virtual bool | equals (Object::View v) const | |||
virtual size32_t | hashCode () const | |||
Return a hash code value for the Object. This method is supported for the benefit of hash-based containers.
The general contract of
The default implementation is identity based.
| ||||
virtual void | toStream (std::ostream &out) const | |||
Output a human-readable description of this Object to the given stream. coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toStream method, to output Objects. If a managed String object is desired, the COH_TO_STRING macro can be used to build up a String from streamable contents.
Object::View vKey = ... Object::View vValue = ... std::cout << vKey << " = " << vValue << std::endl; String::Handle hs = COH_TO_STRING(vKey << " = " << vValue);
| ||||
virtual Object::View | getValue () const | |||
Get the object to compare the reflection result with. | ||||
Static Public Member Functions | ||||
static int32_t | calculateIteratorEffectiveness (int32_t cKeys) | |||
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. | ||||
Protected Member Functions | ||||
ComparisonFilter () | ||||
Default constructor (necessary for the ExternalizableLite interface). | ||||
ComparisonFilter (ValueExtractor::View vValueExtractor, Object::View vObject) | ||||
Construct a ComparisonFilter. | ||||
virtual int32_t | calculateMatchEffectiveness (Map::View vMapIndexes, Set::View vSetKeys) const | |||
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. | ||||
virtual int32_t | calculateRangeEffectiveness (Map::View vMapIndexes, Set::View vSetKeys) const | |||
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. | ||||
Protected Attributes | ||||
FinalView< Object > | f_vValue | |||
The value to compare to. |
ComparisonFilter | ( | ValueExtractor::View | vValueExtractor, | |
Object::View | vObject | |||
) | [protected] |
Construct a ComparisonFilter.
vExtractor | the ComparisonFilter to use by this filter | |
vObject | the object to compare the result with |
virtual int32_t calculateMatchEffectiveness | ( | Map::View | vMapIndexes, | |
Set::View | vSetKeys | |||
) | const [protected, virtual] |
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.
vMapIndexes | the available MapIndex objects keyed by the related ValueExtractor; read-only | |
vSetKeys | the set of keys that will be filtered; read-only |
virtual int32_t calculateRangeEffectiveness | ( | Map::View | vMapIndexes, | |
Set::View | vSetKeys | |||
) | const [protected, virtual] |
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.
vMapIndexes | the available MapIndex objects keyed by the related ValueExtractor; read-only | |
vSetKeys | the set of keys that will be filtered; read-only |
static int32_t calculateIteratorEffectiveness | ( | int32_t | cKeys | ) | [static] |
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.
cKeys | the number of keys to iterate through |
virtual Object::View getValue | ( | ) | const [virtual] |
Get the object to compare the reflection result with.