Package org.aksw.jenax.arq.aggregation
Class Aggregators
java.lang.Object
org.aksw.jenax.arq.aggregation.Aggregators
Utils to bridge Aggregators with Java
Collector- Author:
- raven
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <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
-
Constructor Details
-
Aggregators
public Aggregators()
-
-
Method Details
-
createCollector
public static <T,E, Collector<T,C extends Collection<T>> org.aksw.commons.collector.domain.Accumulator<T, createCollectorE, C>, C> (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 collectionC- The output collection type- Parameters:
aggregator- The backing aggregator- Returns:
-
createCollectorRaw
public static <T,E, Collector<T,C extends Collection<T>> org.aksw.commons.collector.domain.Accumulator<T, createCollectorRawE, C>, org.aksw.commons.collector.domain.Accumulator<T, E, C>> (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, Collector<T,V, C extends Collection<V>> org.aksw.commons.collector.domain.Accumulator<T, createCollectorRawE, C>, org.aksw.commons.collector.domain.Accumulator<T, E, C>> (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, org.aksw.commons.collector.domain.Accumulator<T,V, C extends Collection<V>> E, combineAccumulatorsC> (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:
-