Java Code Examples for org.apache.tinkerpop.gremlin.process.traversal.step.HasContainerHolder#getHasContainers()

The following examples show how to use org.apache.tinkerpop.gremlin.process.traversal.step.HasContainerHolder#getHasContainers() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TraversalUtil.java    From hugegraph with Apache License 2.0 6 votes vote down vote up
public static void extractHasContainer(HugeGraphStep<?, ?> newStep,
                                       Traversal.Admin<?, ?> traversal) {
    Step<?, ?> step = newStep;
    do {
        step = step.getNextStep();
        if (step instanceof HasStep) {
            HasContainerHolder holder = (HasContainerHolder) step;
            for (HasContainer has : holder.getHasContainers()) {
                if (!GraphStep.processHasContainerIds(newStep, has)) {
                    newStep.addHasContainer(has);
                }
            }
            TraversalHelper.copyLabels(step, step.getPreviousStep(), false);
            traversal.removeStep(step);
        }
    } while (step instanceof HasStep || step instanceof NoOpBarrierStep);
}
 
Example 2
Source File: BaseStrategy.java    From sqlg with MIT License 6 votes vote down vote up
private boolean isNotWithMultipleColumnValue(HasContainerHolder currentStep) {
    for (HasContainer h : currentStep.getHasContainers()) {
        P<?> predicate = h.getPredicate();
        //noinspection unchecked
        if (predicate.getValue() instanceof ZonedDateTime ||
                predicate.getValue() instanceof Period ||
                predicate.getValue() instanceof Duration ||
                (predicate.getValue() instanceof List && containsWithMultipleColumnValue((List<Object>) predicate.getValue())) ||
                (predicate instanceof ConnectiveP && isConnectivePWithMultipleColumnValue((ConnectiveP) h.getPredicate()))) {


            return false;
        }

    }
    return true;
}
 
Example 3
Source File: TraversalUtil.java    From hugegraph with Apache License 2.0 5 votes vote down vote up
public static void extractHasContainer(HugeVertexStep<?> newStep,
                                       Traversal.Admin<?, ?> traversal) {
    Step<?, ?> step = newStep;
    do {
        if (step instanceof HasStep) {
            HasContainerHolder holder = (HasContainerHolder) step;
            for (HasContainer has : holder.getHasContainers()) {
                newStep.addHasContainer(has);
            }
            TraversalHelper.copyLabels(step, step.getPreviousStep(), false);
            traversal.removeStep(step);
        }
        step = step.getNextStep();
    } while (step instanceof HasStep || step instanceof NoOpBarrierStep);
}
 
Example 4
Source File: TraversalUtil.java    From hugegraph with Apache License 2.0 4 votes vote down vote up
public static void convHasStep(HugeGraph graph, HasStep<?> step) {
    HasContainerHolder holder = step;
    for (HasContainer has : holder.getHasContainers()) {
        convPredicateValue(graph, has);
    }
}