I'm trying to creating a Graph instance in Prefuse through the following approach:
Graph(Table nodes, Table edges, boolean directed)
/*
Create a new Graph, using node table row numbers to uniquely identify nodes in the edge table's source and target fields.
*/
So I create a Table object to store the nodes and edges data like this. However, this is a problem:
Table nodes=new Table(2,3);
//here is the error eclipse reports:integer can't be resolved to a variable
nodes.addColumn("id",integer);
nodes.addColumn("name", String);
nodes.addColumn("gender", String);
nodes.addRows(4);
nodes.set(0, 0, 1);
nodes.set(0, 1, "Abbas");
nodes.set(0, 2, "M");
nodes.set(1, 0, 2);
nodes.set(1, 1, "Hassan");
nodes.set(1, 2, "F");
The API describes the method "addColumn" as
public void addColumn(java.lang.String name,
java.lang.Class type)
Add a column with the given name and data type to this table.