Oracle Coherence for C++ API


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.

tb/lh 2010.08.31
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.

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
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.
hMapIndex  a Map of ValueExtractor to MapIndex to be updated by removing the index being destroyed
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 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);
out  the stream used to output the description

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.

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

MemberView< Filter m_vFilter
  The filter used by this extractor.
< ValueExtractor
  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.

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.

UnsupportedOperationException  always

Reimplemented from AbstractExtractor.

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