2010-03-06 11:17:58 +01:00
|
|
|
package com.metaweb.gridworks.clustering;
|
|
|
|
|
|
|
|
import org.json.JSONObject;
|
|
|
|
|
|
|
|
import com.metaweb.gridworks.Jsonizable;
|
|
|
|
import com.metaweb.gridworks.browsing.Engine;
|
|
|
|
import com.metaweb.gridworks.model.Column;
|
|
|
|
import com.metaweb.gridworks.model.Project;
|
|
|
|
|
|
|
|
public abstract class Clusterer implements Jsonizable {
|
|
|
|
|
|
|
|
protected Project _project;
|
|
|
|
protected int _colindex;
|
|
|
|
protected JSONObject _config;
|
|
|
|
|
|
|
|
public abstract void computeClusters(Engine engine);
|
|
|
|
|
|
|
|
public void initializeFromJSON(Project project, JSONObject o) throws Exception {
|
|
|
|
_project = project;
|
|
|
|
_config = o;
|
|
|
|
|
|
|
|
String colname = o.getString("column");
|
|
|
|
for (Column column : project.columnModel.columns) {
|
2010-03-06 23:48:42 +01:00
|
|
|
if (column.getName().equals(colname)) {
|
2010-03-06 11:17:58 +01:00
|
|
|
_colindex = column.getCellIndex();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|