Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.2.1.3.0)

E80355-01

ConditionalExtractor Class Reference

#include <coherence/util/extractor/ConditionalExtractor.hpp>

Inherits AbstractExtractor, IndexAwareExtractor, and PortableObject.

List of all members.


Detailed Description

An IndexAwareExtractor implementation that is only used to create a coherence::util::ConditionalIndex.

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.

Author:
tb/lh 2010.08.31
Since:
Coherence 3.6

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.

Parameters:
fOrdered true iff the contents of the indexed information should be ordered; false otherwise
vComparator the Comparator object which imposes an ordering of entries in the index contents; or NULL if the entries' values natural ordering should be used
hMapIndex a Map of ValueExtractor to MapIndex to be updated with the created index
Returns:
the created index; NULL if the index has not been created

virtual MapIndex::Handle destroyIndex (Map::Handle hMapIndex) const
 Destroy an existing index and remove it from the given map of indexes.

Parameters:
hMapIndex a Map of ValueExtractor to MapIndex to be updated by removing the index being destroyed
Returns:
the destroyed index; NULL if the index does not exist

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);
     }

Returns:
a string representation of this object

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 hashCode is:

  • Whenever it is invoked on the same Object more than once during an execution of an application, the hashCode method must consistently return the same value, provided no information used in equals comparisons on the object is modified. This value need not remain consistent from one execution of an application to another execution of the same application.
  • If two Objects are equal according to the equals method, then calling the hashCode method on each of the two Objects must produce the same value.
  • It is not required that if two Objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct results. However, the programmer should be aware that producing distinct results for unequal objects may improve the performance of hash-based containers.

The default implementation is identity based.

Returns:
a hash code value for this Object


Protected Member Functions

 ConditionalExtractor ()
 Construct the ConditionalExtractor.
 ConditionalExtractor (Filter::View vFilter, ValueExtractor::View vExtractor, bool fForwardIndex)
 Construct the ConditionalExtractor.

Protected Attributes

FinalView< Filterf_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.

Constructor & Destructor Documentation

ConditionalExtractor ( Filter::View  vFilter,
ValueExtractor::View  vExtractor,
bool  fForwardIndex 
) [protected]

Construct the ConditionalExtractor.

Parameters:
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


Member Function Documentation

virtual Object::Holder extract ( Object::Holder  ohTarget  )  const [virtual]

Using a ConditionalExtractor to extract values in not supported.

Exceptions:
UnsupportedOperationException always

Reimplemented from AbstractExtractor.


The documentation for this class was generated from the following file:
Copyright © 2000, 2017, Oracle and/or its affiliates. All rights reserved.