• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Column类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Column类属于prefuse.data.column包,在下文中一共展示了Column类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initializeCountColumn

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * Initialize the column with the counts of elements in them.
 * 
 * @param field
 *            the name of the dataColumn to histogrammize
 * @param dataColumn
 *            the column in the original (@link prefuse.data.Table)
 *            to be histogramized.
 */
private void initializeCountColumn( String field, Column dataColumn )
{
	int binSlot;
	int currentCount;  // separate var just for debugging ease
	String countField = getCountField( field );

	// initialize everything to 0 before starting to count
	for ( int binIndex = 0; binIndex < m_binCount; binIndex++ ) {
		set( binIndex, countField, 0 );
	}

	double dataColumnMin = m_binMin.get( field );
	double cellValue;
	for ( int dataRowIndex = 0; dataRowIndex < dataColumn.getRowCount(); dataRowIndex++ ) {
		cellValue = dataColumn.getDouble( dataRowIndex );
		binSlot = (int)( ( cellValue - dataColumnMin ) / m_binWidth );
		currentCount = getInt( binSlot, countField );
		setInt( binSlot, countField, currentCount + 1 );
	}
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:30,代码来源:HistogramTable.java


示例2: getNumericColumnMinMax

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * @param aColumn
 *            the column to get min/max of
 * @return min and max (in an array) of aColumn
 */
private double[] getNumericColumnMinMax( Column aColumn )
{
	double oldMin = aColumn.getDouble( 0 );
	double oldMax = oldMin;
	double[] minMax = new double[2];

	if ( aColumn.canGetDouble() ) {
		double currentValue;
		for ( int rowIndex = 1; rowIndex < aColumn.getRowCount(); rowIndex++ ) {
			currentValue = aColumn.getDouble( rowIndex );
			oldMin = Math.min( oldMin, currentValue );
			oldMax = Math.max( oldMax, currentValue );
		}
	}

	minMax[0] = oldMin;
	minMax[1] = oldMax;
	return minMax;
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:25,代码来源:HistogramTable.java


示例3: columnChanged

import prefuse.data.column.Column; //导入依赖的package包/类
public void columnChanged(Column src, int idx, long prev) {
    if ( src==m_scol || src==m_tcol ) {
        boolean isSrc = src==m_scol;
        int e = m_edges.getTableRow(idx, isSrc?m_sidx:m_tidx);
        if ( e == -1 )
            return; // edge not in this graph
        int s = getSourceNode(e);
        int t = getTargetNode(e);
        int p = getNodeIndex(prev);
        if ( p > -1 && ((isSrc && t > -1) || (!isSrc && s > -1)) )
            updateDegrees(e, isSrc?p:s, isSrc?t:p, -1);
        if ( s > -1 && t > -1 )
            updateDegrees(e, s, t, 1);
    } else {
        throw new IllegalStateException();
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:18,代码来源:Graph.java


示例4: removeRow

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * Removes a row from this table.
 * @param row the row to delete
 * @return true if the row was successfully deleted, false if the
 * row was already invalid
 */
public boolean removeRow(int row) {
    if ( m_rows.isValidRow(row) ) {
        // the order of operations here is extremely important
        // otherwise listeners may end up with corrupted state.
        // fire update *BEFORE* clearing values
        // allow listeners (e.g., indices) to perform clean-up
        fireTableEvent(row, row, EventConstants.ALL_COLUMNS, 
        		EventConstants.DELETE);
        // invalidate the tuple
        m_tuples.invalidate(row);
        // release row with row manager
        // do this before clearing column values, so that any
        // listeners can determine that the row is invalid
        m_rows.releaseRow(row);
        // now clear column values
        for ( Iterator<Column> cols = getColumns(); cols.hasNext(); ) {
            Column c = cols.next();
            c.revertToDefault(row);
        }
        return true;
    }
    return false;
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:30,代码来源:Table.java


示例5: removeColumn

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * Internal method for removing a column.
 * @param idx the column number of the column to remove
 * @return the removed Column instance
 */
protected Column removeColumn(int idx) {
    // make sure index is legal
    if ( idx < 0 || idx >= m_columns.size() ) {
        throw new IllegalArgumentException("Column index is not legal.");
    }
    
    String name = m_names.get(idx);
    (m_entries.get(name)).dispose();
    Column col = m_columns.remove(idx);
    m_entries.remove(name);
    m_names.remove(idx);
    renumberColumns();
    
    m_lastCol = -1;
    invalidateSchema();
    
    // ignore what the old column has to say
    col.removeColumnListener(this);
    
    // fire notification
    fireTableEvent(m_rows.getMinimumRow(), m_rows.getMaximumRow(), 
                   idx, EventConstants.DELETE);
    
    return col;
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:31,代码来源:Table.java


示例6: index

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * Create (if necessary) and return an index over the given data field.
 * The first call to this method with a given field name will cause the
 * index to be created and stored. Subsequent calls will simply return
 * the stored index. To attempt to retrieve an index without triggering
 * creation of a new index, use the {@link #getIndex(String)} method.
 * @param field the data field name of the column to index
 * @return the index over the specified data column
 */
public Index index(String field) {
    ColumnEntry e = m_entries.get(field);
    if ( e == null ) {
        throw new IllegalArgumentException("Unknown column name: "+field);
    } else if ( e.index != null ) {
        return e.index; // already indexed
    }
    
    Column col = e.column;
    try {
        e.index = new TreeIndex(this, m_rows, col, null);
    } catch ( IncompatibleComparatorException ice ) { /* can't happen */ }
    
    return e.index;
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:25,代码来源:Table.java


示例7: handleColumnChanged

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * Handle a column change event.
 * @param c the modified column
 * @param start the starting row of the modified range
 * @param end the ending row (inclusive) of the modified range
 */
protected void handleColumnChanged(Column c, int start, int end) {
    for ( ; !isValidRow(start) && start <= end; ++start );
    if ( start > end ) return; // bail if no valid rows
    
    // determine the index of the updated column
    int idx;
    if ( m_lastCol != -1 && c == getColumn(m_lastCol) ) {
        // constant time
        idx = m_lastCol;
    } else {
        // linear time
        idx = getColumnNumber(c);
    }
    
    // if we have a valid index, fire a notification
    if ( idx >= 0 ) {
        fireTableEvent(start, end, idx, EventConstants.UPDATE);
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:26,代码来源:Table.java


示例8: columnChanged

import prefuse.data.column.Column; //导入依赖的package包/类
public void columnChanged(Column src, int idx, long prev) {
	if (src == m_scol || src == m_tcol) {
		boolean isSrc = src == m_scol;
		int e = m_edges.getTableRow(idx, isSrc ? m_sidx : m_tidx);
		if (e == -1)
			return; // edge not in this graph
		int s = getSourceNode(e);
		int t = getTargetNode(e);
		int p = isSrc ? getNode1Index(prev) : getNode2Index(prev);
		if (p > -1 && ((isSrc && t > -1) || (!isSrc && s > -1)))
			updateDegrees(e, isSrc ? p : s, isSrc ? t : p, -1);
		if (s > -1 && t > -1)
			updateDegrees(e, s, t, 1);
	} else {
		throw new IllegalStateException();
	}
}
 
开发者ID:ieg-vienna,项目名称:ieg-prefuse,代码行数:18,代码来源:BipartiteGraph.java


示例9: HistogramTable

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * @param aTable
 *            a Prefuse Table with data values (i.e. non-histogrammized) in it
 * @param aBinCount
 *            how many bins the data's range should be split into
 */
public HistogramTable( Table aTable, int aBinCount )
{
	super();

	if ( aBinCount <= 0 ) {
		throw new IllegalArgumentException( "Bin count must be a positive number." );
	}

	String[] fieldNames = getFieldNames( aTable );

	m_binCount = aBinCount;
	initializeHistogramTable( fieldNames, m_binCount );

	for ( int fieldIndex = 0; fieldIndex < fieldNames.length; fieldIndex++ ) {
		String field = fieldNames[fieldIndex];

		Column dataColumn = aTable.getColumn( field );
		if ( dataColumn == null ) {
			throw new NullPointerException( "Column not found for field " + field );
		}

		if ( dataColumn.canGetDouble() ) {
			initializeNumericColumn( field, dataColumn );
		}
		else if ( dataColumn.canGetString() ) {
			initializeStringColumn( field, dataColumn );
		}
		else {
			// Can't really histogrammize any other data in a sensible way, ignore it *shrug*
			continue;
		}
	}
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:40,代码来源:HistogramTable.java


示例10: initializeNumericColumn

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * @param field
 *            the name of the dataColumn to histogrammize
 * @param dataColumn
 *            the dataColumn to histogrammize
 */
private void initializeNumericColumn( String field, Column dataColumn )
{
	addColumn( field, double.class );
	getColumn( field ).setParser( new DoubleParser() );
	String countField = getCountField( field );

	addColumn( countField, int.class );
	getColumn( countField ).setParser( new IntParser() );

	initializeNumericBinInfo( field, dataColumn );
	initializeNumericBinColumn( field );
	initializeCountColumn( field, dataColumn );
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:20,代码来源:HistogramTable.java


示例11: initializeNumericBinInfo

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * @param field
 *            the name of the dataColumn to histogrammize
 * @param dataColumn
 *            the dataColumn to histogrammize
 */
private void initializeNumericBinInfo( String field, Column dataColumn )
{
	double[] minMax = new double[2];
	minMax = getNumericColumnMinMax( dataColumn );
	double minValue = minMax[0];
	double maxValue = minMax[1];

	m_binMax.put( field, maxValue );
	m_binMin.put( field, minValue );

	m_binWidth = ( 1 + maxValue - minValue ) / m_binCount;

	assert m_binWidth >= 0.0 : "m_binWidth < 0!";
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:21,代码来源:HistogramTable.java


示例12: getColumnNumber

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * @see prefuse.data.Table#getColumnNumber(prefuse.data.column.Column)
 */
public int getColumnNumber(Column col) {
    int idx = m_columns.indexOf(col);
    if ( idx == -1 && m_parent != null ) {
        idx = m_parent.getColumnNumber(col);
        if ( idx == -1 ) return idx;
        String name = m_parent.getColumnName(idx);
        idx = m_pnames.indexOf(name);
        if ( idx != -1 ) idx += m_columns.size();
    }
    return idx;
 }
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:15,代码来源:CascadedTable.java


示例13: getColumn

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * @see prefuse.data.Table#getColumn(int)
 */
public Column getColumn(int col) {
    m_lastCol = col;
    int local = m_names.size();
    if ( col >= local && m_parent != null ) {
        return m_parent.getColumn((String)m_pnames.get(col-local));
    } else {
        return (Column)m_columns.get(col);
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:13,代码来源:CascadedTable.java


示例14: Table

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * Create a new Table.
 * @param nrows the starting number of table rows
 * @param ncols the starting capacity for columns 
 * @param tupleType the class of the Tuple instances to use
 */
protected Table(int nrows, int ncols, Class tupleType) {
    m_listeners = new CopyOnWriteArrayList<TableListener>();
    m_columns = new ArrayList<Column>(ncols);
    m_names = new ArrayList<String>(ncols);
    m_rows = new RowManager(this);
    m_entries = new HashMap<String, ColumnEntry>(ncols+5);        
    m_tuples = new TupleManager(this, null, tupleType);

    if ( nrows > 0 )
        addRows(nrows);
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:18,代码来源:Table.java


示例15: updateRowCount

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * Internal method that updates the row counts for local data columns.
 */
protected void updateRowCount() {
    int maxrow = m_rows.getMaximumRow() + 1;
    
    // update columns
    Iterator<Column> cols = getColumns();
    while ( cols.hasNext() ) {
        Column c = cols.next();
        c.setMaximumRow(maxrow);
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:14,代码来源:Table.java


示例16: addColumn

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * Internal method for adding a column.
 * @param name the name of the column
 * @param col the actual Column instance
 */
protected void addColumn(String name, Column col) {
    int idx = getColumnNumber(name);
    if ( idx >= 0 && idx < m_columns.size() ) {
        throw new IllegalArgumentException(
            "Table already has column with name \""+name+"\"");
    }
    
    // add the column
    m_columns.add(col);
    m_names.add(name);
    m_lastCol = m_columns.size()-1;
    ColumnEntry entry = new ColumnEntry(m_lastCol, col, 
            new ColumnMetadata(this, name));
    
    // add entry, dispose of an overridden entry if needed
    ColumnEntry oldEntry = m_entries.put(name, entry);
    if ( oldEntry != null ) oldEntry.dispose();
    
    invalidateSchema();
    
    // listen to what the column has to say
    col.addColumnListener(this);
    
    // fire notification
    fireTableEvent(m_rows.getMinimumRow(), m_rows.getMaximumRow(), 
            m_lastCol, EventConstants.INSERT);
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:33,代码来源:Table.java


示例17: ColumnEntry

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * Create a new ColumnEntry.
 * @param col the column number
 * @param column the Column instance
 * @param metadata the ColumnMetadata instance
 */
public ColumnEntry(int col, Column column, ColumnMetadata metadata) {
    this.colnum = col;
    this.column = column;
    this.metadata = metadata;
    this.index = null;
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:13,代码来源:Table.java


示例18: TreeIndex

import prefuse.data.column.Column; //导入依赖的package包/类
/**
    * Create a new TreeIndex.
    * @param t the Table containing the data column to index
    * @param rows the RowManager of the Table
    * @param col the Column instance to index
    * @param cmp the Comparator to use to sort data values
    * @throws IncompatibleComparatorException if the comparator is not
    * compatible with the column's data type
    */
   @SuppressWarnings("rawtypes")
public TreeIndex(Table t, RowManager rows, Column col, Comparator cmp)
       throws IncompatibleComparatorException
   {
       m_table = t;
       m_rows = rows;
       m_col = col;
       
       m_index = SortedMapFactory.getMap(col.getColumnType(), cmp, false);
       index();
       
       m_col.addColumnListener(this);
       m_table.addTableListener(this);
   }
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:24,代码来源:TreeIndex.java


示例19: columnChanged

import prefuse.data.column.Column; //导入依赖的package包/类
/**
 * @see prefuse.data.event.ColumnListener#columnChanged(prefuse.data.column.Column, int, boolean)
 */
public void columnChanged(Column src, int idx, boolean prev) {
    int row = m_rows.getTableRow(idx, getColumnIndex());
    if ( row < 0 ) return; // invalid row value
    ((BooleanIntSortedMap)m_index).remove(prev, row);
    ((BooleanIntSortedMap)m_index).put(src.getBoolean(idx), row);
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:10,代码来源:TreeIndex.java


示例20: removeColumn

import prefuse.data.column.Column; //导入依赖的package包/类
@Override
protected Column removeColumn(int idx) {
    Column col = this.getColumn(idx);
    if (col instanceof TemporalColumn) {
        String idColumn = TemporalTable.idColumnNameFor(super.getColumnName(idx));
        ((TemporalColumn)col).store.unregister(this, idColumn);
        super.removeColumn(idColumn);
    }
    return super.removeColumn(idx);
}
 
开发者ID:ieg-vienna,项目名称:TimeBench,代码行数:11,代码来源:TemporalTable.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DatasetFactory类代码示例发布时间:2022-05-15
下一篇:
Java ThriftServiceProcessor类代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap