use of com.google.refine.model.Row in project OpenRefine by OpenRefine.
the class TemplatingExporterTests method CreateGrid.
protected void CreateGrid(int noOfRows, int noOfColumns) {
CreateColumns(noOfColumns);
for (int i = 0; i < noOfRows; i++) {
Row row = new Row(noOfColumns);
for (int j = 0; j < noOfColumns; j++) {
row.cells.add(new Cell("row" + i + "cell" + j, null));
}
project.rows.add(row);
}
}
use of com.google.refine.model.Row in project OpenRefine by OpenRefine.
the class TsvExporterTests method CreateGrid.
protected void CreateGrid(int noOfRows, int noOfColumns) {
CreateColumns(noOfColumns);
for (int i = 0; i < noOfRows; i++) {
Row row = new Row(noOfColumns);
for (int j = 0; j < noOfColumns; j++) {
row.cells.add(new Cell("row" + i + "cell" + j, null));
}
project.rows.add(row);
}
}
use of com.google.refine.model.Row in project OpenRefine by OpenRefine.
the class RowRemovalChange method apply.
@Override
public void apply(Project project) {
synchronized (project) {
int count = _rowIndices.size();
_rows = new ArrayList<Row>(count);
int offset = 0;
for (int i = 0; i < count; i++) {
int index = _rowIndices.get(i);
Row row = project.rows.remove(index + offset);
_rows.add(row);
offset--;
}
project.columnModel.clearPrecomputes();
ProjectManager.singleton.getInterProjectModel().flushJoinsInvolvingProject(project.id);
project.update();
}
}
use of com.google.refine.model.Row in project OpenRefine by OpenRefine.
the class RowStarChange method revert.
@Override
public void revert(Project project) {
Row row = project.rows.get(rowIndex);
row.starred = oldStarred;
}
use of com.google.refine.model.Row in project OpenRefine by OpenRefine.
the class ImporterUtilitiesTests method ensureColumnsInRowExistDoesExpand.
@Test
public void ensureColumnsInRowExistDoesExpand() {
Row row = new Row(4);
for (int i = 1; i < 5; i++) {
row.cells.add(new Cell("value" + i, null));
}
ArrayList<String> columnNames = new ArrayList<String>(2);
ImporterUtilities.ensureColumnsInRowExist(columnNames, row);
Assert.assertEquals(row.cells.size(), 4);
Assert.assertEquals(columnNames.size(), 4);
}
Aggregations