Oracle Coherence for C++ API
Release 3.7.1.0

E22845-01

DistinctValues Class Reference

#include <coherence/util/aggregator/DistinctValues.hpp>

Inherits AbstractAggregator.

List of all members.


Detailed Description

Return the set of unique values extracted from a set of entries in a Map.

If the set of entries is empty, an empty set is returned.

This aggregator could be used in combination with coherence::util::extractor::MultiExtractor allowing to collect all unique combinations (tuples) of a given set of attributes.

The DistinctValues aggregator covers a simple case of a more generic aggregation pattern implemented by the GroupAggregator, which in addition to collecting all distinct values or tuples, runs an aggregation against each distinct entry set (group).

Author:
djl 2008.05.12
 

Public Types

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

Protected Member Functions

 DistinctValues ()
 Default constructor (necessary for the PortableObject interface).
 DistinctValues (ValueExtractor::View vExtractor)
 Construct a DistinceValues aggregator.
virtual void init (bool fFinal)
 Initialize the aggregation result.

Parameters:
 fFinal true is passed if the aggregation process that is being initialized must produce a final aggregation result; this will only be false if a parallel approach is being used and the initial (partial) aggregation process is being initialized
virtual void process (Object::View vO, bool fFinal)
 Incorporate one aggregatable value into the result.

If the fFinal parameter is true, the given object is a partial result (returned by an individual parallel aggregator) that should be incorporated into the final result; otherwise, the object is a value extracted from an coherence::util::InvocableMap::Entry.

Parameters:
 vO the value to incorporate into the aggregated result
 fFinal true to indicate that the given object is a partial result returned by a parallel aggregator
virtual Object::Holder finalizeResult (bool fFinal)
 Obtain the result of the aggregation.

If the fFinal parameter is true, the returned object must be the final result of the aggregation; otherwise, the returned object will be treated as a partial result that should be incorporated into the final result.

Parameters:
 fFinal true to indicate that the final result of the aggregation process should be returned; this will only be false if a parallel approach is being used
Returns:
the result of the aggregation process
virtual Set::Handle ensureSet ()
 Return a set that can be used to store distinct values, creating it if one has not already been created.

Protected Attributes

MemberHandle< Setm_hSet
 The resulting set of distinct values.

Constructor & Destructor Documentation

DistinctValues ( ValueExtractor::View  vExtractor  )  [protected]

Construct a DistinceValues aggregator.

Parameters:
 vExtractor the extractor that provides a value in the form of any object


Member Function Documentation

virtual Set::Handle ensureSet (  )  [protected, virtual]

Return a set that can be used to store distinct values, creating it if one has not already been created.

Returns:
a set that can be used to store distinct values


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