本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep类的典型用法代码示例。如果您正苦于以下问题:Java AggregateStep类的具体用法?Java AggregateStep怎么用?Java AggregateStep使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AggregateStep类属于org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect包,在下文中一共展示了AggregateStep类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep; //导入依赖的package包/类
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
if (!(traversal.getParent() instanceof EmptyStep) || TraversalHelper.onGraphComputer(traversal))
return;
final List<Step> steps = traversal.getSteps();
if (steps.size() < 2 ||
!(steps.get(0) instanceof GraphStep) ||
0 != ((GraphStep) steps.get(0)).getIds().length ||
!(steps.get(steps.size() - 1) instanceof CountGlobalStep))
return;
for (int i = 1; i < steps.size() - 1; i++) {
final Step current = steps.get(i);
if (!(current instanceof MapStep ||
current instanceof IdentityStep ||
current instanceof NoOpBarrierStep ||
current instanceof CollectingBarrierStep) ||
(current instanceof TraversalParent &&
TraversalHelper.anyStepRecursively(s -> (s instanceof SideEffectStep || s instanceof AggregateStep), (TraversalParent) current)))
return;
}
final Class<? extends Element> elementClass = ((GraphStep<?, ?>) steps.get(0)).getReturnClass();
TraversalHelper.removeAllSteps(traversal);
traversal.addStep(new TinkerCountGlobalStep<>(traversal, elementClass));
}
示例2: aggregate
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep; //导入依赖的package包/类
public default GraphTraversal<S, E> aggregate(final String sideEffectKey) {
return this.asAdmin().addStep(new AggregateStep<>(this.asAdmin(), sideEffectKey));
}
示例3: aggregate
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep; //导入依赖的package包/类
/**
* Eagerly collects objects up to this step into a side-effect.
*
* @param sideEffectKey the name of the side-effect key that will hold the aggregated objects
* @return the traversal with an appended {@link AggregateStep}
* @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#aggregate-step" target="_blank">Reference Documentation - Aggregate Step</a>
* @since 3.0.0-incubating
*/
public default GraphTraversal<S, E> aggregate(final String sideEffectKey) {
this.asAdmin().getBytecode().addStep(Symbols.aggregate, sideEffectKey);
return this.asAdmin().addStep(new AggregateStep<>(this.asAdmin(), sideEffectKey));
}