Module swim.util
Package swim.util

Interface ReducedMap<K,V,U>

All Superinterfaces:
Iterable<Map.Entry<K,V>>, IterableMap<K,V>, Map<K,V>, OrderedMap<K,V>, SortedMap<K,V>
All Known Implementing Classes:
BTreeMap, BTreeMap, ValueReducedMap

public interface ReducedMap<K,V,U> extends OrderedMap<K,V>
An OrderedMap that memoizes partial combinations of sub-elements to support efficient, incremental reduction of continuously mutating datasets.
  • Method Details

    • reduced

      U reduced(U identity, CombinerFunction<? super V,U> accumulator, CombinerFunction<U,U> combiner)
      Returns the reduction of this ReducedMap, combining all contained elements with the given accumulator and combiner functions, recomputing only what has changed since the last invocation of reduced. Stores partial computations to accelerate repeated reduction of continuously mutating datasets.