Java Code Examples for org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep#getDirection()

The following examples show how to use org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep#getDirection() . 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: HugeVertexStep.java    From hugegraph with Apache License 2.0 5 votes vote down vote up
public HugeVertexStep(final VertexStep<E> originVertexStep) {
    super(originVertexStep.getTraversal(),
          originVertexStep.getReturnClass(),
          originVertexStep.getDirection(),
          originVertexStep.getEdgeLabels());
    originVertexStep.getLabels().forEach(this::addLabel);
}
 
Example 2
Source File: IncidentToAdjacentStrategy.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
/**
 * Optimizes the given edge-emitting step and the vertex-emitting step by replacing them with a single
 * vertex-emitting step.
 *
 * @param traversal the traversal that holds the given steps
 * @param step1     the edge-emitting step to replace
 * @param step2     the vertex-emitting step to replace
 */
private static void optimizeSteps(final Traversal.Admin traversal, final VertexStep step1, final Step step2) {
    final Step newStep = new VertexStep(traversal, Vertex.class, step1.getDirection(), step1.getEdgeLabels());
    for (final String label : (Iterable<String>) step2.getLabels()) {
        newStep.addLabel(label);
    }
    TraversalHelper.replaceStep(step1, newStep, traversal);
    traversal.removeStep(step2);
}
 
Example 3
Source File: TinkerMessenger.java    From tinkergraph-gremlin with Apache License 2.0 4 votes vote down vote up
private static Direction getDirection(final Traversal.Admin<Vertex, Edge> incidentTraversal) {
    final VertexStep step = TraversalHelper.getLastStepOfAssignableClass(VertexStep.class, incidentTraversal).get();
    return step.getDirection();
}
 
Example 4
Source File: JanusGraphVertexStep.java    From grakn with GNU Affero General Public License v3.0 4 votes vote down vote up
public JanusGraphVertexStep(VertexStep<E> originalStep) {
    super(originalStep.getTraversal(), originalStep.getReturnClass(), originalStep.getDirection(), originalStep.getEdgeLabels());
    originalStep.getLabels().forEach(this::addLabel);
    this.hasContainers = new ArrayList<>();
    this.limit = Query.NO_LIMIT;
}
 
Example 5
Source File: HBaseVertexStep.java    From hgraphdb with Apache License 2.0 4 votes vote down vote up
public HBaseVertexStep(final VertexStep<E> originalVertexStep) {
    super(originalVertexStep.getTraversal(), originalVertexStep.getReturnClass(), originalVertexStep.getDirection(), originalVertexStep.getEdgeLabels());
    originalVertexStep.getLabels().forEach(this::addLabel);
}
 
Example 6
Source File: TitanVertexStep.java    From titan1withtp3.1 with Apache License 2.0 4 votes vote down vote up
public TitanVertexStep(VertexStep<E> originalStep) {
    super(originalStep.getTraversal(), originalStep.getReturnClass(), originalStep.getDirection(), originalStep.getEdgeLabels());
    originalStep.getLabels().forEach(this::addLabel);
    this.hasContainers = new ArrayList<>();
    this.limit = Query.NO_LIMIT;
}
 
Example 7
Source File: TinkerMessenger.java    From tinkerpop with Apache License 2.0 4 votes vote down vote up
private static Direction getDirection(final Traversal.Admin<Vertex, Edge> incidentTraversal) {
    final VertexStep step = TraversalHelper.getLastStepOfAssignableClass(VertexStep.class, incidentTraversal).get();
    return step.getDirection();
}