Package prefuse.data.util

Examples of prefuse.data.util.TableIterator


     * Return a TableIterator over the given rows of this table.
     * @param rows an iterator over the table rows to visit
     * @return a TableIterator over this table
     */
    public TableIterator iterator(IntIterator rows) {
        return new TableIterator(this, rows);
    }
View Full Code Here


            System.out.println(filter.toString());
        }
       
        CascadedTable ft = new CascadedTable(t, filter);

        TableIterator iter = ft.iterator();
        while ( iter.hasNext() ) {
            int row = iter.nextInt();
            try {
                for (int c = 0; c < NCOLS; ++c) {
                    Object o1 = TABLE[c][ft.getColumnRow(row,c)];
                    Object o2 = ft.get(row,HEADERS[c]);
                    assertEquals(o1, o2);
                }
            } catch (Exception e) {
                fail("Caught exception: " + e);
            }
        }

        // add an extra column to the cascaded table
        String name = "test";
        ft.addColumn(name, double.class, new Double(Math.PI));
        iter = ft.iterator();
        while (iter.hasNext()) {
            int row = iter.nextInt();
            iter.setDouble(name, Math.E);
            assertTrue(Math.E == ft.getDouble(row, name));
        }

        int nr = t.addRow();
        t.setInt(nr, HEADERS[0], nr+1);
View Full Code Here

        }
       
        // add an extra column to the cascaded table
        String name = "test";
        ft.addColumn(name, double.class, new Double(Math.PI));
        TableIterator iter = ft.iterator();
        while ( iter.hasNext() ) {
            int row = iter.nextInt();
            iter.setDouble(name, Math.E);
            assertTrue(Math.E == ft.getDouble(row, name));
        }
       
        int nr = t.addRow();
        t.setFloat(nr, HEADERS[3], 0.5f);
View Full Code Here

        }
       
        // add an extra column to the filtered table
        String name = "test";
        vt.addColumn(name, double.class, new Double(Math.PI));
        TableIterator iter = vt.iterator();
        while ( iter.hasNext() ) {
            int row = iter.nextInt();
            iter.setDouble(name, Math.E);
            assertTrue(Math.E == vt.getDouble(row, name));
        }
       
        int nr = t.addRow();
        t.setFloat(nr, HEADERS[3], 0.5f);
View Full Code Here

        Expression avg = new ArithmeticExpression(
                ArithmeticExpression.DIV, add, l2);
       
        t.addColumn(AVG, avg);
       
        TableIterator it = t.iterator();
        while ( it.hasNext() ) {
            it.nextInt();
            float  f = it.getFloat(HEADERS[3]);
            double d = it.getDouble(HEADERS[4]);
            double av = (f+d)/2;
            assertTrue(av == it.getDouble(AVG));
        }
       
        int r = t.addRow();
        assertTrue(t.getDouble(r, AVG) == 0.0);
       
View Full Code Here

TOP

Related Classes of prefuse.data.util.TableIterator

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.