当前位置: 首页>>代码示例>>Java>>正文


Java Table.getColumnCount方法代码示例

本文整理汇总了Java中prefuse.data.Table.getColumnCount方法的典型用法代码示例。如果您正苦于以下问题:Java Table.getColumnCount方法的具体用法?Java Table.getColumnCount怎么用?Java Table.getColumnCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在prefuse.data.Table的用法示例。


在下文中一共展示了Table.getColumnCount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeTable

import prefuse.data.Table; //导入方法依赖的package包/类
/**
 * @see prefuse.data.io.TableWriter#writeTable(prefuse.data.Table, java.io.OutputStream)
 */
public void writeTable(Table table, OutputStream os) throws DataIOException {
    try {            
        // get print stream
        PrintStream out = new PrintStream(new BufferedOutputStream(os));
        
        // write out header row
        if ( m_printHeader ) {
            for ( int i=0; i<table.getColumnCount(); ++i ) {
                if ( i>0 ) out.print(m_delim);
                out.print(table.getColumnName(i));
            }
            out.println();
        }
        
        // write out data
        for ( IntIterator rows = table.rows(); rows.hasNext(); ) {
            int row = rows.nextInt();
            for ( int i=0; i<table.getColumnCount(); ++i ) {
                if ( i>0 ) out.print(m_delim);
                out.print(table.getString(row, table.getColumnName(i)));
            }
            out.println();
        }
        
        // finish up
        out.flush();
    } catch ( Exception e ) {
        throw new DataIOException(e);
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:34,代码来源:DelimitedTextTableWriter.java

示例2: writeTable

import prefuse.data.Table; //导入方法依赖的package包/类
/**
 * @see prefuse.data.io.TableWriter#writeTable(prefuse.data.Table, java.io.OutputStream)
 */
public void writeTable(Table table, OutputStream os) throws DataIOException {
    try {            
        // get print stream
        PrintStream out = new PrintStream(new BufferedOutputStream(os));
        
        // write out header row
        if ( m_printHeader ) {
            for ( int i=0; i<table.getColumnCount(); ++i ) {
                if ( i>0 ) out.print(',');
                out.print(makeCSVSafe(table.getColumnName(i)));
            }
            out.println();
        }
        
        // write out data
        for ( IntIterator rows = table.rows(); rows.hasNext(); ) {
            int row = rows.nextInt();
            for ( int i=0; i<table.getColumnCount(); ++i ) {
                if ( i>0 ) out.print(',');
                String str = table.getString(row, table.getColumnName(i));
                out.print(makeCSVSafe(str));
            }
            out.println();
        }
        
        // finish up
        out.flush();
    } catch ( Exception e ) {
        throw new DataIOException(e);
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:35,代码来源:CSVTableWriter.java

示例3: writeTable

import prefuse.data.Table; //导入方法依赖的package包/类
/**
    * @see prefuse.data.io.TableWriter#writeTable(prefuse.data.Table, java.io.OutputStream)
    */
   @SuppressWarnings("rawtypes")
public void writeTable(Table table, OutputStream os) throws DataIOException {
       try {            
           // get print stream
           PrintStream out = new PrintStream(new BufferedOutputStream(os));
           
           // build array of column padding
           char[] pad = new char[table.getColumnCount()];
           boolean[] pre = new boolean[table.getColumnCount()];
           for (int i=0; i<table.getColumnCount(); ++i ) {
           	Class type = table.getColumnType(i);
           	pre[i] = TypeLib.isNumericType(type);
           	pad[i] = pre[i] ? '0' : ' ';
           }
           
           // write out data
           for ( IntIterator rows = table.rows(); rows.hasNext(); ) {
               int row = rows.nextInt();
               for ( int i=0; i<table.getColumnCount(); ++i ) {
               	out.print(pack(table.getString(row, i), 
               				   m_schema.getColumnLength(i),
               				   pre[i], pad[i]));
               }
               out.println();
           }
           
           // finish up
           out.flush();
       } catch ( Exception e ) {
           throw new DataIOException(e);
       }
   }
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:36,代码来源:FixedWidthTextTableWriter.java

示例4: tableToString

import prefuse.data.Table; //导入方法依赖的package包/类
String tableToString(Table table)
{
	StringBuilder strb = new StringBuilder();
	for(int row = 0; row < table.getRowCount(); row++)
	{
		for(int col = 0; col < table.getColumnCount(); col++)
		{
			strb.append(table.get(row, col));
			strb.append(" ");
		}
		strb.append("\n");
	}
	
	return strb.toString();
}
 
开发者ID:FedericoPecora,项目名称:meta-csp-framework,代码行数:16,代码来源:PlotSTPTemporalModule.java

示例5: getFieldNames

import prefuse.data.Table; //导入方法依赖的package包/类
/**
 * @param aTable
 *            a HistogramTable or Prefuse Table
 * @return fieldNames a list of the names of the columns in the table.
 *         Note that a HistogramTable will have all the same column names as
 *         are in its (Prefuse Table) data table's, but will also have an additional
 *         set of columns that have the counts. See getCountField().
 *         TODO It might be interesting to have a method getNonCountFieldNames which
 *         strips out the count fields.
 */
public static String[] getFieldNames( Table aTable )
{
	int columnCount = aTable.getColumnCount();
	String[] fieldNames = new String[columnCount];
	for ( int columnIndex = 0; columnIndex < columnCount; columnIndex++ ) {
		fieldNames[columnIndex] = aTable.getColumnName( columnIndex );
	}
	return fieldNames;
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:20,代码来源:HistogramTable.java


注:本文中的prefuse.data.Table.getColumnCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。