本文整理汇总了Java中prefuse.data.Table.set方法的典型用法代码示例。如果您正苦于以下问题:Java Table.set方法的具体用法?Java Table.set怎么用?Java Table.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prefuse.data.Table
的用法示例。
在下文中一共展示了Table.set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processInstanceData
import prefuse.data.Table; //导入方法依赖的package包/类
/**
* Processes raw hierarchy data and saves it in the specified table.
*
* @param config
* the application config
* @param hierarchy
* the hierarchy to process
* @param hierarchyTree
* the processed hierarchy tree
* @param table
* the table the processed data will be saved in.
*/
private static void processInstanceData(
HVConfig config,
LoadedHierarchy hierarchy,
Tree hierarchyTree, Table table )
{
// TODO: Implement some sort of culling so that we remove overlapping instances?
// Could use k-d trees maybe?
for ( Instance instance : hierarchy.getMainHierarchy().getRoot().getSubtreeInstances() ) {
int row = table.addRow();
double[] data = instance.getData();
for ( int i = 0; i < data.length; ++i ) {
table.set( row, i, data[i] );
}
prefuse.data.Node node = findGroup( hierarchyTree, instance.getNodeId() );
table.set( row, HVConstants.PREFUSE_INSTANCE_NODE_COLUMN_NAME, node );
if ( hierarchy.options.hasTrueClassAttribute ) {
table.set( row, HVConstants.PREFUSE_INSTANCE_TRUENODE_ID_COLUMN_NAME, instance.getTrueClass() );
}
if ( hierarchy.options.hasInstanceNameAttribute ) {
table.set( row, HVConstants.PREFUSE_INSTANCE_LABEL_COLUMN_NAME, instance.getInstanceName() );
}
}
}
示例2: generateTable
import prefuse.data.Table; //导入方法依赖的package包/类
private Table generateTable()
{
Table table = new Table();
// use a calendar for input of human-readable dates
GregorianCalendar cal = new GregorianCalendar();
// set up table schema
table.addColumn("Date", Date.class);
table.addColumn("BMI", double.class);
table.addColumn("NBZ", int.class);
table.addColumn("Insult", String.class);
int items = 100;
table.addRows(items);
Random randomGenerator = new Random();
for(int i = 0; i < items / 2; i++)
{
table.set(i, 0, cal.getTime());
table.set(i, 1, randomGenerator.nextDouble() * 40);
table.set(i, 2, randomGenerator.nextDouble() * 400);
table.set(i, 3, "T");
}
for(int i = items/2; i<items; i++)
{
table.set(i, 0, cal.getTime());
table.set(i, 1, randomGenerator.nextDouble() * 40);
table.set(i, 2, randomGenerator.nextDouble() * 400);
table.set(i, 3, "F");
}
/** add items outside of visible area (for performance check) **/
// for(int j = 5000; j<items; j++)
// {
// String insult = randomGenerator.nextBoolean() ? "T" : "F";
// table.set(j, 0, cal.getTime());
// table.set(j, 1, 400);
// table.set(j, 2, randomGenerator.nextDouble() * 400);
// table.set(j, 3, insult);
// }
return table;
}
示例3: generateTableForPerforamceTest
import prefuse.data.Table; //导入方法依赖的package包/类
private Table generateTableForPerforamceTest()
{
Table table = new Table();
// use a calendar for input of human-readable dates
GregorianCalendar cal = new GregorianCalendar();
// set up table schema
table.addColumn("Date", Date.class);
table.addColumn("BMI", double.class);
table.addColumn("NBZ", int.class);
table.addColumn("Insult", String.class);
int items = 2500;
table.addRows(items);
Random randomGenerator = new Random();
for(int i = 0; i < items / 2; i++)
{
table.set(i, 0, cal.getTime());
table.set(i, 1, randomGenerator.nextDouble() * 40);
table.set(i, 2, randomGenerator.nextDouble() * 400);
table.set(i, 3, "T");
}
for(int i = items/2; i<items; i++)
{
table.set(i, 0, cal.getTime());
table.set(i, 1, randomGenerator.nextDouble() * 40);
table.set(i, 2, randomGenerator.nextDouble() * 400);
table.set(i, 3, "F");
}
/** add items outside of visible area (for performance check) **/
// for(int j = 5000; j<items; j++)
// {
// String insult = randomGenerator.nextBoolean() ? "T" : "F";
// table.set(j, 0, cal.getTime());
// table.set(j, 1, 400);
// table.set(j, 2, randomGenerator.nextDouble() * 400);
// table.set(j, 3, insult);
// }
return table;
}
示例4: generateTable
import prefuse.data.Table; //导入方法依赖的package包/类
private Table generateTable()
{
Table table = new Table();
// use a calendar for input of human-readable dates
GregorianCalendar cal = new GregorianCalendar();
// set up table schema
table.addColumn("Date", Date.class);
table.addColumn("BMI", double.class);
table.addColumn("NBZ", int.class);
table.addColumn("Insult", String.class);
int items = 5000;
table.addRows(items);
//
// cal.set(2007, 11, 23);
// table.set(0, 0, cal.getTime());
// table.set(0, 1, 21.0);
// table.set(0, 2, 236.0);
// table.set(0, 3, "F");
//
// cal.set(2008, 6, 22);
// table.set(1, 0, cal.getTime());
// table.set(1, 1, 35.8);
// table.set(1, 2, 400.0);
// table.set(1, 3, "F");
//
// cal.set(2009, 3, 8);
// table.set(2, 0, cal.getTime());
// table.set(2, 1, 28.8);
// table.set(2, 2, 309.0);
// table.set(2, 3, "T");
Random randomGenerator = new Random();
for(int i = 0; i<items; i++)
{
String insult = randomGenerator.nextBoolean() ? "T" : "F";
table.set(i, 0, cal.getTime());
table.set(i, 1, randomGenerator.nextDouble() * 40);
table.set(i, 2, randomGenerator.nextDouble() * 400);
table.set(i, 3, insult);
}
/** add items outside of visible area **/
// for(int i = 5000; i<items; i++)
// {
// String insult = randomGenerator.nextBoolean() ? "T" : "F";
// table.set(i, 0, cal.getTime());
// table.set(i, 1, 400);
// table.set(i, 2, randomGenerator.nextDouble() * 400);
// table.set(i, 3, insult);
// }
return table;
}