@@ -0,0 +1,2663 @@
+package ieg.prefuse.data;%0D%0A%0D%0Aimport java.io.PrintStream;%0D%0Aimport java.util.Iterator;%0D%0A%0D%0Aimport prefuse.data.Table;%0D%0Aimport prefuse.data.Tuple;%0D%0Aimport prefuse.data.tuple.TupleSet;%0D%0A%0D%0Apublic class DataHelper %7B%0D%0A    %0D%0A    /**%0D%0A     * build a debug string on meta data of a table column%0D%0A     * @param t the table to debug%0D%0A     * @param col the column number of the data field to retrieve%0D%0A     * @return a debug string%0D%0A     */%0D%0A    public static String debugColumnMeta(Table t, int col) %7B%0D%0A        return t.getColumnName(col)%0D%0A                + %22 type=%22%0D%0A                + t.getColumnType(col).getName()%0D%0A                + %22 min=%22%0D%0A                + t.getString(%0D%0A                        t.getMetadata(t.getColumnName(col)).getMinimumRow(), col)%0D%0A                + %22 max=%22%0D%0A                + t.getString(%0D%0A                        t.getMetadata(t.getColumnName(col)).getMaximumRow(), col);%0D%0A    %7D%0D%0A    %0D%0A    /**%0D%0A     * build a debug string on values of a column%0D%0A     * @param t the table to debug%0D%0A     * @param col the column number of the data field to retrieve%0D%0A     * @return a debug string%0D%0A     */%0D%0A    public static String debugColumnValues(Table t, int col) %7B%0D%0A        StringBuilder sb = new StringBuilder(t.getString(0, col));%0D%0A        for (int i=1; i %3C t.getRowCount(); i++) %7B%0D%0A            sb.append(%22, %22);%0D%0A            sb.append(t.getString(i, col));%0D%0A        %7D%0D%0A        return sb.toString();%0D%0A    %7D%0D%0A    %0D%0A    /**%0D%0A     * Helper method to dump specific columns of a table or other tuple set to some output stream%0D%0A     * @param out the output to use%0D%0A     * @param table the Table to print%0D%0A     * @param cols the name of the columns%0D%0A     */%0D%0A    @SuppressWarnings(%22unchecked%22)%0D%0A    public static void printTable(PrintStream out, TupleSet table, String... cols) %7B%0D%0A        %0D%0A        for (String c : cols) %0D%0A            out.printf(%22 %2516s%22, c + %22 %22);%0D%0A            %0D%0A        out.println();%0D%0A%0D%0A        Iterator%3CTuple%3E i = table.tuples();%0D%0A        while (i.hasNext()) %7B%0D%0A            Tuple tuple = i.next();%0D%0A            %0D%0A            for (String c : cols) %0D%0A                if (tuple.canGetString(c))%0D%0A                    out.printf(%22 %2516s%22, tuple.getString(c) + %22 %22);%0D%0A%0D%0A            out.println();%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * Helper method to dump a table to some output stream%0D%0A     * @param out the output to use%0D%0A     * @param table the Table to print%0D%0A     */%0D%0A    public static void printTable(PrintStream out, Table table) %7B%0D%0A        String%5B%5D cols = new String%5Btable.getColumnCount()%5D;%0D%0A        for (int i=0; i%3C cols.length; i++) %0D%0A            cols%5Bi%5D = table.getColumnName(i);%0D%0A        %0D%0A        printTable(out, table, cols);%0D%0A    %7D%0D%0A%7D%0D%0A

make some useful helper methods available (originally developed for VisuExplore and TimeBench)