#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 TypedHandle < const String > | toString () const |
Output a human-readable description of this Object to the given stream. Note that when overriding this method the return type must be TypedHandle<const String> rather then String::View. These two types are assignment compatible but not equivalent and declaring the override with String::View will not be a compatible override. coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toString 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 and is generally how toString() will be implemented.
Object::View vKey = ... Object::View vValue = ... std::cout << vKey << " = " << vValue << std::endl; String::View vs = COH_TO_STRING(vKey << " = " << vValue); The COH_TO_STRING macro is also the most common way to implement the toString method. For example:
virtual TypedHandle<const String> Person::toString() const { return COH_TO_STRING("Name: " << f_sName << " SSN: " << f_nSSN); }
| |
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.