public static class ConverterCollections.ConverterInvocableMap extends ConverterCollections.ConverterMap implements InvocableMap, Serializable
InvocableMap.Entry<K,V>, InvocableMap.EntryAggregator<K,V,R>, InvocableMap.EntryProcessor<K,V,R>, InvocableMap.ParallelAwareAggregator<K,V,P,R>, InvocableMap.StreamingAggregator<K,V,P,R>
Constructor and Description |
---|
ConverterInvocableMap(InvocableMap map,
Converter convKeyUp,
Converter convKeyDown,
Converter convValUp,
Converter convValDown)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
aggregate(Collection collKeys,
InvocableMap.EntryAggregator agent)
Perform an aggregating operation against the entries specified by the
passed keys.
|
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.
|
Object |
invoke(Object oKey,
InvocableMap.EntryProcessor agent)
Invoke the passed EntryProcessor against the Entry specified by the
passed key, returning the result of the invocation.
|
Map |
invokeAll(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.
|
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.
|
getConverterKeyDown, getConverterKeyUp, getConverterValueDown, getConverterValueUp, instantiateMap, subMap
clear, containsKey, containsValue, entrySet, equals, get, getMap, hashCode, instantiateCollection, instantiateEntrySet, instantiateSet, isEmpty, keySet, put, putAll, remove, size, toString, values
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
aggregate, compute, compute, computeIfAbsent, computeIfAbsent, computeIfPresent, computeIfPresent, getOrDefault, invokeAll, merge, merge, putIfAbsent, remove, replace, replace, replaceAll, replaceAll, replaceAll, replaceAll, stream, stream, stream, stream, stream, stream
public ConverterInvocableMap(InvocableMap map, Converter convKeyUp, Converter convKeyDown, Converter convValUp, Converter convValDown)
map
- the underlying InvocableMapconvKeyUp
- the Converter to view the underlying
InvocableMap's keys throughconvKeyDown
- the Converter to use to pass keys down to the
underlying InvocableMapconvValUp
- the Converter to view the underlying
InvocableMap's values throughconvValDown
- the Converter to use to pass values down to the
underlying InvocableMappublic Object aggregate(Collection collKeys, InvocableMap.EntryAggregator agent)
aggregate
in interface InvocableMap
collKeys
- the Collection of keys that specify the entries within
this Map to aggregate acrossagent
- the EntryAggregator that is used to aggregate across
the specified entries of this Mappublic Object aggregate(Filter filter, InvocableMap.EntryAggregator agent)
aggregate
in interface InvocableMap
filter
- the Filter that is used to select entries within this
Map to aggregate acrossagent
- the EntryAggregator that is used to aggregate across
the selected entries of this Mappublic Object invoke(Object oKey, InvocableMap.EntryProcessor agent)
invoke
in interface InvocableMap
oKey
- the key to process; it is not required to exist within
the Mapagent
- the EntryProcessor to use to process the specified keypublic Map invokeAll(Collection collKeys, InvocableMap.EntryProcessor agent)
invokeAll
in interface InvocableMap
collKeys
- the keys to process; these keys are not required to
exist within the Mapagent
- the EntryProcessor to use to process the specified keyspublic Map invokeAll(Filter filter, InvocableMap.EntryProcessor agent)
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
.
invokeAll
in interface InvocableMap
filter
- a Filter that results in the set of keys to be
processedagent
- the EntryProcessor to use to process the specified keyspublic InvocableMap getInvocableMap()