Class Aggregators

java.lang.Object
org.aksw.jenax.arq.aggregation.Aggregators

public class Aggregators extends Object
Utils to bridge Aggregators with Java Collector
Author:
raven
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T, E, V, C extends Collection<V>>
    org.aksw.commons.collector.domain.Accumulator<T,E,C>
    combineAccumulators(org.aksw.commons.collector.domain.Accumulator<T,E,C> needle, org.aksw.commons.collector.domain.Accumulator<T,E,C> haystack, UnaryOperator<org.aksw.commons.collector.domain.Accumulator<T,E,C>> accumulatorCloner, Function<? super V,? extends T> valueToItem)
    Merge two accumulators.
    static <T, E, C extends Collection<T>>
    Collector<T,org.aksw.commons.collector.domain.Accumulator<T,E,C>,C>
    createCollector(org.aksw.commons.collector.domain.Aggregator<T,E,C> aggregator)
    Create a collector from an aggregator.
    static <T, E, V, C extends Collection<V>>
    Collector<T,org.aksw.commons.collector.domain.Accumulator<T,E,C>,org.aksw.commons.collector.domain.Accumulator<T,E,C>>
    createCollectorRaw(org.aksw.commons.collector.domain.Aggregator<T,E,C> aggregator, Function<? super V,? extends T> valueToItem, UnaryOperator<org.aksw.commons.collector.domain.Accumulator<T,E,C>> accumulatorCloner)
     
    static <T, E, C extends Collection<T>>
    Collector<T,org.aksw.commons.collector.domain.Accumulator<T,E,C>,org.aksw.commons.collector.domain.Accumulator<T,E,C>>
    createCollectorRaw(org.aksw.commons.collector.domain.Aggregator<T,E,C> aggregator, UnaryOperator<org.aksw.commons.collector.domain.Accumulator<T,E,C>> accumulatorCloner)
    createCollector(Aggregator) but returning the raw accumulator rather than finishing it to its value

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Aggregators

      public Aggregators()
  • Method Details

    • createCollector

      public static <T, E, C extends Collection<T>> Collector<T,org.aksw.commons.collector.domain.Accumulator<T,E,C>,C> createCollector(org.aksw.commons.collector.domain.Aggregator<T,E,C> aggregator)
      Create a collector from an aggregator. Combinations of accumulators happens in-place in the larger accumulator.
      Type Parameters:
      T - The item type used both in the reduction and the output collection
      C - The output collection type
      Parameters:
      aggregator - The backing aggregator
      Returns:
    • createCollectorRaw

      public static <T, E, C extends Collection<T>> Collector<T,org.aksw.commons.collector.domain.Accumulator<T,E,C>,org.aksw.commons.collector.domain.Accumulator<T,E,C>> createCollectorRaw(org.aksw.commons.collector.domain.Aggregator<T,E,C> aggregator, UnaryOperator<org.aksw.commons.collector.domain.Accumulator<T,E,C>> accumulatorCloner)
      createCollector(Aggregator) but returning the raw accumulator rather than finishing it to its value
    • createCollectorRaw

      public static <T, E, V, C extends Collection<V>> Collector<T,org.aksw.commons.collector.domain.Accumulator<T,E,C>,org.aksw.commons.collector.domain.Accumulator<T,E,C>> createCollectorRaw(org.aksw.commons.collector.domain.Aggregator<T,E,C> aggregator, Function<? super V,? extends T> valueToItem, UnaryOperator<org.aksw.commons.collector.domain.Accumulator<T,E,C>> accumulatorCloner)
    • combineAccumulators

      public static <T, E, V, C extends Collection<V>> org.aksw.commons.collector.domain.Accumulator<T,E,C> combineAccumulators(org.aksw.commons.collector.domain.Accumulator<T,E,C> needle, org.aksw.commons.collector.domain.Accumulator<T,E,C> haystack, UnaryOperator<org.aksw.commons.collector.domain.Accumulator<T,E,C>> accumulatorCloner, Function<? super V,? extends T> valueToItem)
      Merge two accumulators.
      Type Parameters:
      T -
      C -
      Parameters:
      needle -
      haystack -
      accumulatorCloner - The cloner; may return its argument for in place changes.
      Returns: