当前位置: 首页>>代码示例>>Java>>正文


Java AggregateStep类代码示例

本文整理汇总了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));
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:25,代码来源:TinkerGraphCountStrategy.java

示例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));
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:4,代码来源:GraphTraversal.java

示例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));
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:13,代码来源:GraphTraversal.java


注:本文中的org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。