#include <coherence/util/extractor/ConditionalExtractor.hpp>
Inherits AbstractExtractor, IndexAwareExtractor, and PortableObject.
Note: the underlying ValueExtractor is used for value extraction during index creation and is the extractor that is associated with the created coherence::util::ConditionalIndex in the given index map. Using the ConditionalExtractor to extract values is not supported.
Public Types | ||||||||||
typedef spec::Handle | Handle | |||||||||
ConditionalExtractor Handle definition. | ||||||||||
typedef spec::View | View | |||||||||
ConditionalExtractor View definition. | ||||||||||
typedef spec::Holder | Holder | |||||||||
ConditionalExtractor Holder definition. | ||||||||||
Public Member Functions | ||||||||||
virtual MapIndex::Handle | createIndex (bool fOrdered, Comparator::View vComparator, Map::Handle hMapIndex) const | |||||||||
Create an index and associate it with the corresponding extractor. Important: it is a responsibility of this method's implementations to place the necessary <ValueExtractor, MapIndex> entry into the given map of indexes.
| ||||||||||
virtual MapIndex::Handle | destroyIndex (Map::Handle hMapIndex) const | |||||||||
Destroy an existing index and remove it from the given map of indexes.
| ||||||||||
virtual Object::Holder | extract (Object::Holder ohTarget) const | |||||||||
Using a ConditionalExtractor to extract values in not supported. | ||||||||||
virtual void | readExternal (PofReader::Handle hIn) | |||||||||
virtual void | writeExternal (PofWriter::Handle hOut) const | |||||||||
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 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.
| ||||||||||
Protected Member Functions | ||||||||||
ConditionalExtractor () | ||||||||||
Construct the ConditionalExtractor. | ||||||||||
ConditionalExtractor (Filter::View vFilter, ValueExtractor::View vExtractor, bool fForwardIndex) | ||||||||||
Construct the ConditionalExtractor. | ||||||||||
Protected Attributes | ||||||||||
FinalView< Filter > | f_vFilter | |||||||||
The filter used by this extractor. | ||||||||||
FinalView < ValueExtractor > | f_vExtractor | |||||||||
The underlying extractor. | ||||||||||
bool | m_fForwardIndex | |||||||||
Specifies whether or not this extractor will create a coherence::util::ConditionalIndex that supports a forward index. |
ConditionalExtractor | ( | Filter::View | vFilter, | |
ValueExtractor::View | vExtractor, | |||
bool | fForwardIndex | |||
) | [protected] |
Construct the ConditionalExtractor.
vFilter | the filter used by this extractor to create a ConditionalIndex; must not be NULL | |
vExtractor | the extractor used by this extractor to create a ConditionalIndex; Note that the created index will be associated with this extractor in the given index map; must not be NULL | |
fForwardIndex | specifies whether or not this extractor will create a ConditionalIndex that supports a forward map |
virtual Object::Holder extract | ( | Object::Holder | ohTarget | ) | const [virtual] |
Using a ConditionalExtractor to extract values in not supported.
UnsupportedOperationException | always |
Reimplemented from AbstractExtractor.