Oracle Coherence for C++ API


MultiExtractor Class Reference

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

Inherits AbstractCompositeExtractor.

List of all members.

Detailed Description

Composite ValueExtractor implementation based on an array of extractors.

All extractors in the array are applied to the same target object and the result of the extraction is a List of extracted values.

Common scenarios for using the MultiExtractor involve the DistinctValues or GroupAggregator aggregators, that allow clients to collect all distinct combinations of a given set of attributes or collect and run additional aggregation against the corresponding groups of entries.

djl 2008.04.09

Public Types

typedef spec::Handle  Handle
  MultiExtractor Handle definition.
typedef spec::View  View
  MultiExtractor View definition.
typedef spec::Holder  Holder
  MultiExtractor Holder definition.

Public Member Functions

virtual Object::Holder  extract (Object::Holder ohTarget) const
  Extract the value from the passed object.

The returned value may be NULL.

ohTarget  an Object to retrieve the value from
the extracted value; NULL is an acceptable value
ClassCastException  if this ValueExtractor is incompatible with the passed object to extract a value from and the implementation requires the passed object to be of a certain type
Exception  if this ValueExtractor encounters an exception in the course of extracting the value
IllegalArgumentException  if this ValueExtractor cannot handle the passed object for any other reason; an implementor should include a descriptive message

virtual Object::Holder  extractFromEntry (Map::Entry::Holder ohEntry) const
  Extract the value from the passed entry.
virtual int32_t  compareEntries (QueryMap::Entry::View vEntry1, QueryMap::Entry::View vEntry2) const
  Compare two entries based on the rules specified by Comparator.

If possible, use the coherence::util::QueryMap.Entry::extract() method to optimize the value extraction process.

This method is expected to be implemented by Comparator wrappers, such as ChainedComparator and InverseComparator, which simply pass on this invocation to the wrapped Comparator objects if they too implement this interface, or to invoke their default compare method passing the actual objects (not the extracted values) obtained from the extractor using the passed entries.

This interface is also expected to be implemented by ValueExtractor implementations that implement the Comparator interface. It is expected that in most cases, the Comparator wrappers will eventually terminate at (i.e. delegate to) ValueExtractors that also implement this interface.

vEntry1  the first entry to compare values from; read-only
vEntry2  the second entry to compare values from; read-only
a negative integer, zero, or a positive integer as the first entry denotes a value that is is less than, equal to, or greater than the value denoted by the second entry
ClassCastException  if the arguments' types prevent them from being compared by this Comparator.
IllegalArgumentException  if the extractor cannot handle the passed objects for any other reason; an implementor should include a descriptive message

Static Public Member Functions

static ObjectArray::View  createExtractors (String::View vsNames)
  Parse a comma-delimited sequence of method names and instantiate a corresponding array ValueExtractor objects.

Protected Member Functions

  MultiExtractor ()
  Default constructor (necessary for the PortableObject interface).
  MultiExtractor (ObjectArray::View vaExtractor)
  Construct a MultiExtractor.

Constructor & Destructor Documentation

MultiExtractor ( ObjectArray::View  vaExtractor  )  [protected]

Construct a MultiExtractor.

vaExtractor  the ValueExtractor array

Member Function Documentation

virtual Object::Holder extractFromEntry ( Map::Entry::Holder  ohEntry  )  const [virtual]

Extract the value from the passed entry.

The underlying extractors are applied sequentially, so a result of a previous extractor serves as a target object for a next one. A value of NULL prevents any further extractions and is returned immediately. For intrinsic types, the returned value is expected to be a standard wrapper type in the same manner that reflection works; for example, int32_t would be returned as a Integer32.

Reimplemented from AbstractExtractor.

static ObjectArray::View createExtractors ( String::View  vsNames  )  [static]

Parse a comma-delimited sequence of method names and instantiate a corresponding array ValueExtractor objects.

Individual array elements will be either ReflectionExtractor or ChainedExtractor objects.

vsNames  a comma-delimited sequence of method names
an array of ValueExtractor objects

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