Oracle® Coherence Java API Reference
v3.5.3

E15583-01

com.tangosol.util
Class ConverterCollections.ConverterInvocableMap

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.ConverterCollections.ConverterMap
          extended by com.tangosol.util.ConverterCollections.ConverterInvocableMap
All Implemented Interfaces:
InvocableMap, java.io.Serializable, java.util.Map
Enclosing class:
ConverterCollections

public static class ConverterCollections.ConverterInvocableMap
extends ConverterCollections.ConverterMap
implements InvocableMap, java.io.Serializable

A Converter InvocableMap views an underlying InvocableMap through a set of key and value Converters.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.tangosol.util.InvocableMap
InvocableMap.Entry, InvocableMap.EntryAggregator, InvocableMap.EntryProcessor, InvocableMap.ParallelAwareAggregator
 
Field Summary
 
Fields inherited from class com.tangosol.util.ConverterCollections.ConverterMap
m_convKeyDown, m_convKeyUp, m_convValDown, m_convValUp, m_map, m_set
 
Constructor Summary
ConverterCollections.ConverterInvocableMap(InvocableMap map, Converter convKeyUp, Converter convKeyDown, Converter convValUp, Converter convValDown)
          Constructor.
 
Method Summary
 java.lang.Object aggregate(java.util.Collection collKeys, InvocableMap.EntryAggregator agent)
          Perform an aggregating operation against the entries specified by the passed keys.
 java.lang.Object aggregate(Filter filter, InvocableMap.EntryAggregator agent)
          Perform an aggregating operation against the set of entries that are selected by the given Filter.
 InvocableMap getInvocableMap()
          Return the underlying InvocableMap.
 java.lang.Object invoke(java.lang.Object oKey, InvocableMap.EntryProcessor agent)
          Invoke the passed EntryProcessor against the Entry specified by the passed key, returning the result of the invocation.
 java.util.Map invokeAll(java.util.Collection collKeys, InvocableMap.EntryProcessor agent)
          Invoke the passed EntryProcessor against the entries specified by the passed keys, returning the result of the invocation for each.
 java.util.Map invokeAll(Filter filter, InvocableMap.EntryProcessor agent)
          Invoke the passed EntryProcessor against the set of entries that are selected by the given Filter, returning the result of the invocation for each.
 
Methods inherited from class com.tangosol.util.ConverterCollections.ConverterMap
clear, containsKey, containsValue, entrySet, get, getConverterKeyDown, getConverterKeyUp, getConverterValueDown, getConverterValueUp, getMap, instantiateCollection, instantiateEntrySet, instantiateMap, instantiateSet, isEmpty, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

ConverterCollections.ConverterInvocableMap

public ConverterCollections.ConverterInvocableMap(InvocableMap map,
                                                  Converter convKeyUp,
                                                  Converter convKeyDown,
                                                  Converter convValUp,
                                                  Converter convValDown)
Constructor.

Parameters:
map - the underlying InvocableMap
convKeyUp - the Converter to view the underlying InvocableMap's keys through
convKeyDown - the Converter to use to pass keys down to the underlying InvocableMap
convValUp - the Converter to view the underlying InvocableMap's values through
convValDown - the Converter to use to pass values down to the underlying InvocableMap
Method Detail

aggregate

public java.lang.Object aggregate(java.util.Collection collKeys,
                                  InvocableMap.EntryAggregator agent)
Perform an aggregating operation against the entries specified by the passed keys.

Specified by:
aggregate in interface InvocableMap
Parameters:
collKeys - the Collection of keys that specify the entries within this Map to aggregate across
agent - the EntryAggregator that is used to aggregate across the specified entries of this Map
Returns:
the result of the aggregation

aggregate

public java.lang.Object aggregate(Filter filter,
                                  InvocableMap.EntryAggregator agent)
Perform an aggregating operation against the set of entries that are selected by the given Filter.

Specified by:
aggregate in interface InvocableMap
Parameters:
filter - the Filter that is used to select entries within this Map to aggregate across
agent - the EntryAggregator that is used to aggregate across the selected entries of this Map
Returns:
the result of the aggregation

invoke

public java.lang.Object invoke(java.lang.Object oKey,
                               InvocableMap.EntryProcessor agent)
Invoke the passed EntryProcessor against the Entry specified by the passed key, returning the result of the invocation.

Specified by:
invoke in interface InvocableMap
Parameters:
oKey - the key to process; it is not required to exist within the Map
agent - the EntryProcessor to use to process the specified key
Returns:
the result of the invocation as returned from the EntryProcessor

invokeAll

public java.util.Map invokeAll(java.util.Collection collKeys,
                               InvocableMap.EntryProcessor agent)
Invoke the passed EntryProcessor against the entries specified by the passed keys, returning the result of the invocation for each.

Specified by:
invokeAll in interface InvocableMap
Parameters:
collKeys - the keys to process; these keys are not required to exist within the Map
agent - 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

invokeAll

public java.util.Map invokeAll(Filter filter,
                               InvocableMap.EntryProcessor agent)
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 the ConditionalProcessor.

Specified by:
invokeAll in interface InvocableMap
Parameters:
filter - a Filter that results in the set of keys to be processed
agent - 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

getInvocableMap

public InvocableMap getInvocableMap()
Return the underlying InvocableMap.

Returns:
the underlying InvocableMap

Oracle® Coherence Java API Reference
v3.5.3

E15583-01

Copyright © 2000, 2010, Oracle. All rights reserved.