Package com.tinkerpop.pipes.util.structures

Examples of com.tinkerpop.pipes.util.structures.Table


     *
     * @param columnFunctions the post-processing function for each column
     * @return the extended Pipeline
     */
    public GremlinPipeline<S, E> table(final PipeFunction... columnFunctions) {
        return this.add(new TablePipe(new Table(), null, FluentUtility.getAsPipes(this), FluentUtility.prepareFunctions(this.asMap, columnFunctions)));
    }
View Full Code Here


     * This step is used for grabbing previously seen objects the pipeline as identified by as-steps.
     *
     * @return the extended Pipeline
     */
    public GremlinPipeline<S, E> table() {
        return this.add(new TablePipe(new Table(), null, FluentUtility.getAsPipes(this)));
    }
View Full Code Here

        super.test_g_v1_asXaX_out_properyXnameX_asXbX_table_cap(new GremlinPipeline(g.getVertex(1)).as("a").out().property("name").as("b").table().cap());
        super.test_g_v1_asXaX_out_properyXnameX_asXbX_table_cap(new GremlinPipeline(g.getVertex(1)).optimize(false).as("a").out().property("name").as("b").table().cap());
    }

    public void test_g_v1_asXaX_out_asXbX_tableXnameX_cap() {
        super.test_g_v1_asXaX_out_asXbX_tableXnameX_cap(new GremlinPipeline(g.getVertex(1)).as("a").out().as("b").table(new Table(), new PipeFunction<Vertex, String>() {
            public String compute(Vertex vertex) {
                return (String) vertex.getProperty("name");
            }
        }).cap());

        super.test_g_v1_asXaX_out_asXbX_tableXnameX_cap(new GremlinPipeline(g.getVertex(1)).optimize(false).as("a").out().as("b").table(new Table(), new PipeFunction<Vertex, String>() {
            public String compute(Vertex vertex) {
                return (String) vertex.getProperty("name");
            }
        }).cap());
    }
View Full Code Here

            }
        }).cap());
    }

    public void test_g_v1_asXaX_out_propertyXnameX_asXbX_tableXname_lengthX_cap() {
        super.test_g_v1_asXaX_out_propertyXnameX_asXbX_tableXname_lengthX_cap(new GremlinPipeline(g.getVertex(1)).as("a").out().property("name").as("b").table(new Table(), new PipeFunction<Vertex, String>() {
                    public String compute(Vertex vertex) {
                        return (String) vertex.getProperty("name");
                    }
                }, new PipeFunction<String, Integer>() {
                    public Integer compute(String name) {
                        return name.length();
                    }
                }
        ).cap());

        super.test_g_v1_asXaX_out_propertyXnameX_asXbX_tableXname_lengthX_cap(new GremlinPipeline(g.getVertex(1)).optimize(false).as("a").out().property("name").as("b").table(new Table(), new PipeFunction<Vertex, String>() {
                    public String compute(Vertex vertex) {
                        return (String) vertex.getProperty("name");
                    }
                }, new PipeFunction<String, Integer>() {
                    public Integer compute(String name) {
View Full Code Here

    public PipesPipeline<S, E> table(final Table table, final PipeFunction... columnFunctions) {
        return this.add(new TablePipe<E>(table, null, FluentUtility.getAsPipes(this), FluentUtility.prepareFunctions(this.asMap, columnFunctions)));
    }

    public PipesPipeline<S, E> table(final PipeFunction... columnFunctions) {
        return this.add(new TablePipe<E>(new Table(), null, FluentUtility.getAsPipes(this), FluentUtility.prepareFunctions(this.asMap, columnFunctions)));
    }
View Full Code Here

    public PipesPipeline<S, E> table(final Table table) {
        return this.add(new TablePipe<E>(table, null, FluentUtility.getAsPipes(this)));
    }

    public PipesPipeline<S, E> table() {
        return this.add(new TablePipe<E>(new Table(), null, FluentUtility.getAsPipes(this)));
    }
View Full Code Here

        this.table.addRow(row);
        return s;
    }

    public void reset() {
        this.table = new Table();
        this.currentFunction = 0;
        super.reset();
    }
View Full Code Here

    public void testCompliance() {
        assertTrue(true);
    }

    public void test_g_v1_asXaX_out_properyXnameX_asXbX_table_cap(final Iterator<Table> pipe) {
        Table t = pipe.next();
        assertFalse(pipe.hasNext());
        assertEquals(((Vertex) t.get(0, "a")).getProperty("name"), "marko");
        assertEquals(((Vertex) t.get(1, "a")).getProperty("name"), "marko");
        assertEquals(((Vertex) t.get(2, "a")).getProperty("name"), "marko");
        List<String> names = new ArrayList<String>();
        names.add((String) t.get(0, "b"));
        names.add((String) t.get(1, "b"));
        names.add((String) t.get(2, "b"));
        assertTrue(names.contains("josh"));
        assertTrue(names.contains("lop"));
        assertTrue(names.contains("vadas"));
        assertEquals(names.size(), 3);
        assertEquals(t.getColumnCount(), 2);
        assertEquals(t.getRowCount(), 3);
    }
View Full Code Here

        assertEquals(t.getColumnCount(), 2);
        assertEquals(t.getRowCount(), 3);
    }

    public void test_g_v1_asXaX_out_asXbX_tableXnameX_cap(final Iterator<Table> pipe) {
        Table t = pipe.next();
        assertFalse(pipe.hasNext());
        assertEquals(((String) t.get(0, "a")), "marko");
        assertEquals(((String) t.get(1, "a")), "marko");
        assertEquals(((String) t.get(2, "a")), "marko");
        List<String> names = new ArrayList<String>();
        names.add((String) t.get(0, "b"));
        names.add((String) t.get(1, "b"));
        names.add((String) t.get(2, "b"));
        assertTrue(names.contains("josh"));
        assertTrue(names.contains("lop"));
        assertTrue(names.contains("vadas"));
        assertEquals(names.size(), 3);
        assertEquals(t.getColumnCount(), 2);
        assertEquals(t.getRowCount(), 3);
    }
View Full Code Here

        assertEquals(t.getColumnCount(), 2);
        assertEquals(t.getRowCount(), 3);
    }

    public void test_g_v1_asXaX_out_propertyXnameX_asXbX_tableXname_lengthX_cap(final Iterator<Table> pipe) {
        Table t = pipe.next();
        assertFalse(pipe.hasNext());
        assertEquals(((String) t.get(0, "a")), "marko");
        assertEquals(((String) t.get(1, "a")), "marko");
        assertEquals(((String) t.get(2, "a")), "marko");
        List<Integer> lengths = new ArrayList<Integer>();
        lengths.add((Integer) t.get(0, "b"));
        lengths.add((Integer) t.get(1, "b"));
        lengths.add((Integer) t.get(2, "b"));
        assertTrue(lengths.contains(4));
        assertTrue(lengths.contains(3));
        assertTrue(lengths.contains(5));
        assertEquals(lengths.size(), 3);
        assertEquals(t.getColumnCount(), 2);
        assertEquals(t.getRowCount(), 3);
    }
View Full Code Here

TOP

Related Classes of com.tinkerpop.pipes.util.structures.Table

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.