Package org.aksw.commons.collector.core
Class AggLcaMap<T,E>
java.lang.Object
org.aksw.commons.collector.core.AggLcaMap<T,E>
- All Implemented Interfaces:
Serializable,Aggregator<T,,E, Map<T, T>> ParallelAggregator<T,E, Map<T, T>, Accumulator<T, E, Map<T, T>>>
public class AggLcaMap<T,E>
extends Object
implements ParallelAggregator<T,E,Map<T,T>,Accumulator<T,E,Map<T,T>>>, Serializable
Accumulate mappings of least common ancestors
Assume a backing tree structure:
For each node passed to accumulate assemble a mapping to its LCA with any other lca found so far.
If for a node there is no lca with another entry then the node is mapped to itself.
Hence, the resulting map's key set contains the set of nodes passed to accumulate.
Note: The backing graph must form a tree (not a dag): There must be at most a single lca
for any two nodes.
TODO Extend with counting
TODO Add the AggLcaMap with the combine function
- Author:
- raven
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCombine accumulators.static <T,E> AggLcaMap<T, E> create(SerializableBiFunction<? super T, ? super T, ? extends T> lcaFinder) booleaninthashCode()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aksw.commons.collector.domain.Aggregator
accumulateAll, accumulateAll, accumulateAll, finishMethods inherited from interface org.aksw.commons.collector.domain.ParallelAggregator
asCollector, asCollector, combineRaw
-
Field Details
-
lcaFinder
-
-
Constructor Details
-
AggLcaMap
-
-
Method Details
-
createAccumulator
- Specified by:
createAccumulatorin interfaceAggregator<T,E, Map<T, T>> - Specified by:
createAccumulatorin interfaceParallelAggregator<T,E, Map<T, T>, Accumulator<T, E, Map<T, T>>>
-
combine
Description copied from interface:ParallelAggregatorCombine accumulators. This method is allowed to mutate any of if its arguments, hence accumulators should be considered exhausted after combination. -
hashCode
public int hashCode() -
equals
-
create
public static <T,E> AggLcaMap<T,E> create(SerializableBiFunction<? super T, ? super T, ? extends T> lcaFinder)
-