Search in sources :

Example 1 with Pair

use of com.tinkerpop.pipes.util.structures.Pair in project gremlin by tinkerpop.

the class OrderStepTest method test_g_V_orderXa_nameXb_nameX_name.

public void test_g_V_orderXa_nameXb_nameX_name() {
    super.test_g_V_orderXa_nameXb_nameX_name(new GremlinPipeline(g.getVertices()).order(new PipeFunction<Pair<Vertex, Vertex>, Integer>() {

        public Integer compute(Pair<Vertex, Vertex> argument) {
            return ((String) argument.getB().getProperty("name")).compareTo((String) argument.getA().getProperty("name"));
        }
    }).property("name"));
    super.test_g_V_orderXa_nameXb_nameX_name(new GremlinPipeline(g.getVertices()).optimize(false).order(new PipeFunction<Pair<Vertex, Vertex>, Integer>() {

        public Integer compute(Pair<Vertex, Vertex> argument) {
            return ((String) argument.getB().getProperty("name")).compareTo((String) argument.getA().getProperty("name"));
        }
    }).property("name"));
}
Also used : Vertex(com.tinkerpop.blueprints.Vertex) GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline) Pair(com.tinkerpop.pipes.util.structures.Pair)

Aggregations

Vertex (com.tinkerpop.blueprints.Vertex)1 GremlinPipeline (com.tinkerpop.gremlin.java.GremlinPipeline)1 Pair (com.tinkerpop.pipes.util.structures.Pair)1