use of org.unipop.process.coalesce.UniGraphCoalesceStep in project unipop by unipop-graph.
the class UniGraphCoalesceStepStrategy method apply.
@Override
public void apply(Traversal.Admin<?, ?> traversal) {
Graph graph = traversal.getGraph().get();
if (!(graph instanceof UniGraph)) {
return;
}
UniGraph uniGraph = (UniGraph) graph;
TraversalHelper.getStepsOfClass(CoalesceStep.class, traversal).forEach(coalesceStep -> {
UniGraphCoalesceStep uniGraphCoalesceStep = new UniGraphCoalesceStep(coalesceStep.getTraversal(), uniGraph, coalesceStep.getLocalChildren());
TraversalHelper.replaceStep(coalesceStep, uniGraphCoalesceStep, traversal);
});
}
Aggregations