Java Code Examples for org.apache.tinkerpop.gremlin.process.traversal.util.EmptyTraversal#instance()

The following examples show how to use org.apache.tinkerpop.gremlin.process.traversal.util.EmptyTraversal#instance() . 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: TinkerGraphStepStrategyTest.java    From tinkergraph-gremlin with Apache License 2.0 5 votes vote down vote up
private static GraphStep<?, ?> V(final Object... hasKeyValues) {
    final TinkerGraphStep<Vertex, Vertex> graphStep = new TinkerGraphStep<>(new GraphStep<>(EmptyTraversal.instance(), Vertex.class, true));
    for (int i = 0; i < hasKeyValues.length; i = i + 2) {
        graphStep.addHasContainer(new HasContainer((String) hasKeyValues[i], (P) hasKeyValues[i + 1]));
    }
    return graphStep;
}
 
Example 2
Source File: VertexProgramStrategyTest.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters(name = "{0}")
public static Iterable<Object[]> generateTestParameters() {

    final ComputerResultStep computerResultStep = new ComputerResultStep(EmptyTraversal.instance());
    return Arrays.asList(new Traversal[][]{
            {__.V().out().count(), start().addStep(traversal(__.V().out().count())).addStep(computerResultStep)},
            {__.V().pageRank().out().count(), start().pageRank().asAdmin().addStep(traversal(__.V().out().count())).addStep(computerResultStep)},
            {__.V().out().pageRank(), start().addStep(traversal(__.V().out())).pageRank().asAdmin().addStep(traversal(__.identity())).addStep(computerResultStep)},
            {__.V().out().pageRank().count(), start().addStep(traversal(__.V().out())).pageRank().asAdmin().addStep(traversal(__.count())).addStep(computerResultStep)},
            {__.V().pageRank().order().limit(1), start().pageRank().asAdmin().addStep(traversal(__.V().order().limit(1))).addStep(computerResultStep)}
    });
}
 
Example 3
Source File: TinkerGraphStepStrategyTest.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
private static GraphStep<?, ?> V(final Object... hasKeyValues) {
    final TinkerGraphStep<Vertex, Vertex> graphStep = new TinkerGraphStep<>(new GraphStep<>(EmptyTraversal.instance(), Vertex.class, true));
    for (int i = 0; i < hasKeyValues.length; i = i + 2) {
        graphStep.addHasContainer(new HasContainer((String) hasKeyValues[i], (P) hasKeyValues[i + 1]));
    }
    return graphStep;
}
 
Example 4
Source File: Neo4jGraphStepStrategyTest.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
private static GraphStep<?, ?> V(final Object... hasKeyValues) {
    final Neo4jGraphStep<Vertex, Vertex> graphStep = new Neo4jGraphStep<>(new GraphStep<>(EmptyTraversal.instance(), Vertex.class, true));
    for (int i = 0; i < hasKeyValues.length; i = i + 2) {
        graphStep.addHasContainer(new HasContainer((String) hasKeyValues[i], (P) hasKeyValues[i + 1]));
    }
    return graphStep;
}
 
Example 5
Source File: EmptyStep.java    From tinkerpop with Apache License 2.0 4 votes vote down vote up
@Override
public <A, B> Traversal.Admin<A, B> getTraversal() {
    return EmptyTraversal.instance();
}