use of com.google.refine.model.Record in project OpenRefine by OpenRefine.
the class SortingRecordVisitor method end.
@Override
public void end(Project project) {
_visitor.start(project);
Collections.sort(_records, new Comparator<Record>() {
Project project;
Comparator<Record> init(Project project) {
this.project = project;
return this;
}
@Override
public int compare(Record o1, Record o2) {
return SortingRecordVisitor.this.compare(project, o1, o1.recordIndex, o2, o2.recordIndex);
}
}.init(project));
for (Record record : _records) {
_visitor.visit(project, record);
}
_visitor.end(project);
}
use of com.google.refine.model.Record in project OpenRefine by OpenRefine.
the class ConjunctiveFilteredRecords method accept.
@Override
public void accept(Project project, RecordVisitor visitor) {
try {
visitor.start(project);
int c = project.recordModel.getRecordCount();
for (int r = 0; r < c; r++) {
Record record = project.recordModel.getRecord(r);
if (matchRecord(project, record)) {
if (visitor.visit(project, record)) {
return;
}
}
}
} finally {
visitor.end(project);
}
}
use of com.google.refine.model.Record in project OpenRefine by OpenRefine.
the class NumericBinRecordIndex method iterate.
@Override
protected void iterate(Project project, RowEvaluable rowEvaluable, List<Double> allValues) {
Properties bindings = ExpressionUtils.createBindings(project);
int count = project.recordModel.getRecordCount();
for (int r = 0; r < count; r++) {
Record record = project.recordModel.getRecord(r);
preprocessing();
for (int i = record.fromRowIndex; i < record.toRowIndex; i++) {
Row row = project.rows.get(i);
processRow(project, rowEvaluable, allValues, i, row, bindings);
}
postprocessing();
}
}
use of com.google.refine.model.Record in project OpenRefine by OpenRefine.
the class TimeBinRecordIndex method iterate.
@Override
protected void iterate(Project project, RowEvaluable rowEvaluable, List<Long> allValues) {
Properties bindings = ExpressionUtils.createBindings(project);
int count = project.recordModel.getRecordCount();
for (int r = 0; r < count; r++) {
Record record = project.recordModel.getRecord(r);
preprocessing();
for (int i = record.fromRowIndex; i < record.toRowIndex; i++) {
Row row = project.rows.get(i);
processRow(project, rowEvaluable, allValues, i, row, bindings);
}
postprocessing();
}
}
Aggregations