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


Java SumGlobalStep类代码示例

本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep的典型用法代码示例。如果您正苦于以下问题:Java SumGlobalStep类的具体用法?Java SumGlobalStep怎么用?Java SumGlobalStep使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SumGlobalStep类属于org.apache.tinkerpop.gremlin.process.traversal.step.map包,在下文中一共展示了SumGlobalStep类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isLegal

import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep; //导入依赖的package包/类
public static boolean isLegal(final Traversal.Admin<?, ?> traversal) {
    final Step<?, ?> startStep = traversal.getStartStep();
    final Step<?, ?> endStep = traversal.getEndStep();
    if (!startStep.getClass().equals(GraphStep.class) || ((GraphStep) startStep).returnsEdge())
        return false;
    if (!endStep.getClass().equals(CountGlobalStep.class) &&
            !endStep.getClass().equals(SumGlobalStep.class) &&
            !endStep.getClass().equals(MeanGlobalStep.class) &&
            !endStep.getClass().equals(MaxGlobalStep.class) &&
            !endStep.getClass().equals(MinGlobalStep.class) &&
            !endStep.getClass().equals(FoldStep.class) &&
            !endStep.getClass().equals(GroupStep.class) &&
            !endStep.getClass().equals(GroupCountStep.class))
        // TODO: tree()
        return false;
    if (TraversalHelper.getStepsOfAssignableClassRecursively(Scope.global, Barrier.class, traversal).size() != 1)
        return false;
    if (traversal.getTraverserRequirements().contains(TraverserRequirement.SACK))
        return false;
    return TraversalHelper.isLocalStarGraph(traversal);
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:22,代码来源:SparkStarBarrierInterceptor.java

示例2: isLegal

import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep; //导入依赖的package包/类
public static boolean isLegal(final Traversal.Admin<?, ?> traversal) {
    final Step<?, ?> startStep = traversal.getStartStep();
    final Step<?, ?> endStep = traversal.getEndStep();
    // right now this is not supported because of how the SparkStarBarrierInterceptor mutates the traversal prior to local evaluation
    if (traversal.getStrategies().toList().stream().filter(strategy -> strategy instanceof SubgraphStrategy).findAny().isPresent())
        return false;
    if (!startStep.getClass().equals(GraphStep.class) || ((GraphStep) startStep).returnsEdge())
        return false;
    if (!endStep.getClass().equals(CountGlobalStep.class) &&
            !endStep.getClass().equals(SumGlobalStep.class) &&
            !endStep.getClass().equals(MeanGlobalStep.class) &&
            !endStep.getClass().equals(MaxGlobalStep.class) &&
            !endStep.getClass().equals(MinGlobalStep.class) &&
            !endStep.getClass().equals(FoldStep.class) &&
            !endStep.getClass().equals(GroupStep.class) &&
            !endStep.getClass().equals(GroupCountStep.class))
        // TODO: tree()
        return false;
    if (TraversalHelper.getStepsOfAssignableClassRecursively(Scope.global, Barrier.class, traversal).size() != 1)
        return false;
    if (traversal.getTraverserRequirements().contains(TraverserRequirement.SACK))
        return false;
    return TraversalHelper.isLocalStarGraph(traversal);
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:25,代码来源:SparkStarBarrierInterceptor.java

示例3: isLegal

import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep; //导入依赖的package包/类
public static boolean isLegal(final Traversal.Admin<?, ?> traversal) {
    final Step<?, ?> startStep = traversal.getStartStep();
    final Step<?, ?> endStep = traversal.getEndStep();
    // right now this is not supported because of how the SparkStarBarrierInterceptor mutates the traversal prior to local evaluation
    if (traversal.getStrategies().toList().stream().filter(strategy -> strategy instanceof SubgraphStrategy).findAny().isPresent()) {
        return false;
    }
    if (!startStep.getClass().equals(GraphStep.class) || ((GraphStep) startStep).returnsEdge()) {
        return false;
    }
    if (!endStep.getClass().equals(CountGlobalStep.class) &&
            !endStep.getClass().equals(SumGlobalStep.class) &&
            !endStep.getClass().equals(MeanGlobalStep.class) &&
            !endStep.getClass().equals(MaxGlobalStep.class) &&
            !endStep.getClass().equals(MinGlobalStep.class) &&
            !endStep.getClass().equals(FoldStep.class) &&
            !endStep.getClass().equals(GroupStep.class) &&
            !endStep.getClass().equals(GroupCountStep.class))
    // TODO: tree()
    {
        return false;
    }
    if (TraversalHelper.getStepsOfAssignableClassRecursively(Scope.global, Barrier.class, traversal).size() != 1) {
        return false;
    }
    if (traversal.getTraverserRequirements().contains(TraverserRequirement.SACK)) {
        return false;
    }
    return TraversalHelper.isLocalStarGraph(traversal);
}
 
开发者ID:graknlabs,项目名称:grakn,代码行数:31,代码来源:GraknSparkStarBarrierInterceptor.java

示例4: sum

import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep; //导入依赖的package包/类
public default <E2 extends Number> GraphTraversal<S, E2> sum(final Scope scope) {
    return this.asAdmin().addStep(scope.equals(Scope.global) ? new SumGlobalStep<>(this.asAdmin()) : new SumLocalStep(this.asAdmin()));
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:4,代码来源:GraphTraversal.java

示例5: sum

import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep; //导入依赖的package包/类
/**
 * Map the traversal stream to its reduction as a sum of the {@link Traverser#get} values multiplied by their
 * {@link Traverser#bulk} (i.e. sum the traverser values up to this point).
 *
 * @return the traversal with an appended {@link SumGlobalStep}.
 * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#sum-step" target="_blank">Reference Documentation - Sum Step</a>
 * @since 3.0.0-incubating
 */
public default <E2 extends Number> GraphTraversal<S, E2> sum() {
    this.asAdmin().getBytecode().addStep(Symbols.sum);
    return this.asAdmin().addStep(new SumGlobalStep<>(this.asAdmin()));
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:13,代码来源:GraphTraversal.java


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