當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。