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

E80355-01

InvocableMap Class Reference

#include <coherence/util/InvocableMap.hpp>

Inherits Map.

Inherited by NamedCache [virtual], and ConverterCollections::ConverterInvocableMap [virtual].

List of all members.


Detailed Description

Map with additional query features.

Author:
jh 2008.02.27

Public Types

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

Public Member Functions

virtual Object::Holder invoke (Object::View vKey, EntryProcessor::Handle hAgent)=0
 Invoke the passed EntryProcessor against the Entry specified by the passed key, returning the result of the invocation.
virtual Map::View invokeAll (Collection::View vCollKeys, EntryProcessor::Handle hAgent)=0
 Invoke the passed EntryProcessor against the entries specified by the passed keys, returning the result of the invocation for each.
virtual Map::View invokeAll (Filter::View vFilter, EntryProcessor::Handle hAgent)=0
 Invoke the passed EntryProcessor against the set of entries that are selected by the given Filter, returning the result of the invocation for each.
virtual Object::Holder aggregate (Collection::View vCollKeys, EntryAggregator::Handle hAgent) const =0
 Perform an aggregating operation against the entries specified by the passed keys.
virtual Object::Holder aggregate (Filter::View vFilter, EntryAggregator::Handle hAgent) const =0
 Perform an aggregating operation against the set of entries that are selected by the given Filter.
virtual Object::Holder getOrDefault (Object::View vKey, Object::Holder ohDefaultValue) const
 Get the value associated with the given key or return the default value if there is no value associated with the key.
virtual Object::Holder putIfAbsent (Object::View vKey, Object::Holder ohValue)
 If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.
virtual bool removeValue (Object::View vKey, Object::View vValue)
 Removes the entry for the specified key only if it is currently mapped to the specified value.
virtual Object::Holder replace (Object::View vKey, Object::Holder ohValue)
 Replaces the entry for the specified key only if it is currently mapped to some value.
virtual bool replace (Object::View vKey, Object::View vOldValue, Object::Holder ohNewValue)
 Replaces the entry for the specified key only if currently mapped to the specified value.

Classes

class  Entry
 An InvocableMap::Entry contains additional information and exposes additional operations that the basic Map::Entry does not. More...
class  EntryAggregator
 An EntryAggregator represents processing that can be directed to occur against some subset of the entries in an InvocableMap, resulting in a aggregated result. More...
class  EntryProcessor
 An invocable agent that operates against the Entry objects within a Map. More...
class  ParallelAwareAggregator
 A ParallelAwareAggregator is an advanced extension to EntryAggregator that is explicitly capable of being run in parallel, for example in a distributed environment. More...

Member Function Documentation

virtual Object::Holder invoke ( Object::View  vKey,
EntryProcessor::Handle  hAgent 
) [pure virtual]

Invoke the passed EntryProcessor against the Entry specified by the passed key, returning the result of the invocation.

Parameters:
vKey the key to process; it is not required to exist within the Map
hAgent the EntryProcessor to use to process the specified key
Returns:
the result of the invocation as returned from the EntryProcessor

Implemented in ConverterCollections::ConverterInvocableMap, and ConverterCollections::ConverterNamedCache.

virtual Map::View invokeAll ( Collection::View  vCollKeys,
EntryProcessor::Handle  hAgent 
) [pure virtual]

Invoke the passed EntryProcessor against the entries specified by the passed keys, returning the result of the invocation for each.

Parameters:
vCollKeys the keys to process; these keys are not required to exist within the Map
hAgent the EntryProcessor to use to process the specified keys
Returns:
a Map containing the results of invoking the EntryProcessor against each of the specified keys

Implemented in ConverterCollections::ConverterInvocableMap, ConverterCollections::ConverterInvocableMap, ConverterCollections::ConverterNamedCache, and ConverterCollections::ConverterNamedCache.

virtual Map::View invokeAll ( Filter::View  vFilter,
EntryProcessor::Handle  hAgent 
) [pure virtual]

Invoke the passed EntryProcessor against the set of entries that are selected by the given Filter, returning the result of the invocation for each.

Unless specified otherwise, InvocableMap implementations will perform this operation in two steps: (1) use the filter to retrieve a matching entry set; (2) apply the agent to every filtered entry. This algorithm assumes that the agent's processing does not affect the result of the specified filter evaluation, since the filtering and processing could be performed in parallel on different threads. If this assumption does not hold, the processor logic has to be idempotent, or at least re-evaluate the filter. This could be easily accomplished by wrapping the processor with a ConditionalProcessor.

Parameters:
vFilter a Filter that results in the set of keys to be processed
hAgent the EntryProcessor to use to process the specified keys
Returns:
a Map containing the results of invoking the EntryProcessor against the keys that are selected by the given Filter

Implemented in ConverterCollections::ConverterInvocableMap, ConverterCollections::ConverterInvocableMap, ConverterCollections::ConverterNamedCache, and ConverterCollections::ConverterNamedCache.

virtual Object::Holder aggregate ( Collection::View  vCollKeys,
EntryAggregator::Handle  hAgent 
) const [pure virtual]

Perform an aggregating operation against the entries specified by the passed keys.

Parameters:
vCollKeys the Collection of keys that specify the entries within this Map to aggregate across
hAgent the EntryAggregator that is used to aggregate across the specified entries of this Map
Returns:
the result of the aggregation

Implemented in ConverterCollections::ConverterInvocableMap, ConverterCollections::ConverterInvocableMap, ConverterCollections::ConverterNamedCache, and ConverterCollections::ConverterNamedCache.

virtual Object::Holder aggregate ( Filter::View  vFilter,
EntryAggregator::Handle  hAgent 
) const [pure virtual]

Perform an aggregating operation against the set of entries that are selected by the given Filter.

Parameters:
vFilter the Filter that is used to select entries within this Map to aggregate across
hAgent the EntryAggregator that is used to aggregate across the selected entries of this Map
Returns:
the result of the aggregation

Implemented in ConverterCollections::ConverterInvocableMap, ConverterCollections::ConverterInvocableMap, ConverterCollections::ConverterNamedCache, and ConverterCollections::ConverterNamedCache.

virtual Object::Holder getOrDefault ( Object::View  vKey,
Object::Holder  ohDefaultValue 
) const [virtual]

Get the value associated with the given key or return the default value if there is no value associated with the key.

Parameters:
vKey the key
ohDefaultValue the default value
Returns:
the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key
Since:
Coherence 12.2.1

Reimplemented from Map.

virtual Object::Holder putIfAbsent ( Object::View  vKey,
Object::Holder  ohValue 
) [virtual]

If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.

Parameters:
vKey the key
vValue the value
Returns:
the previous value associated with the specified key, or null if there was no mapping for the key.
Since:
Coherence 12.2.1

Reimplemented from Map.

virtual bool removeValue ( Object::View  vKey,
Object::View  vValue 
) [virtual]

Removes the entry for the specified key only if it is currently mapped to the specified value.

Parameters:
vKey the key
vValue the value
Returns:
true if the value was removed
Since:
Coherence 12.2.1

virtual Object::Holder replace ( Object::View  vKey,
Object::Holder  ohValue 
) [virtual]

Replaces the entry for the specified key only if it is currently mapped to some value.

Parameters:
vKey the key
vValue the value
Returns:
the previous value associated with the specified key, or null if there was no mapping for the key. A null return can also indicate that the map previously associated null with the key.
Since:
Coherence 12.2.1

Reimplemented from Map.

virtual bool replace ( Object::View  vKey,
Object::View  vOldValue,
Object::Holder  ohNewValue 
) [virtual]

Replaces the entry for the specified key only if currently mapped to the specified value.

Parameters:
vKey the key
vOldValue the old value
vNewValue the new value
Returns:
true if the value was replaced
Since:
Coherence 12.2.1

Reimplemented from Map.


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