use of com.google.refine.browsing.util.ExpressionTimeValueBinner in project OpenRefine by OpenRefine.
the class TimeRangeFacet method computeChoices.
@Override
public void computeChoices(Project project, FilteredRows filteredRows) {
if (_eval != null && _errorMessage == null) {
RowEvaluable rowEvaluable = getRowEvaluable(project);
Column column = project.columnModel.getColumnByCellIndex(_cellIndex);
String key = "time-bin:row-based:" + _expression;
TimeBinIndex index = (TimeBinIndex) column.getPrecompute(key);
if (index == null) {
index = new TimeBinRowIndex(project, rowEvaluable);
column.setPrecompute(key, index);
}
retrieveDataFromBaseBinIndex(index);
ExpressionTimeValueBinner binner = new ExpressionTimeValueBinner(rowEvaluable, index);
filteredRows.accept(project, binner);
retrieveDataFromBinner(binner);
}
}
use of com.google.refine.browsing.util.ExpressionTimeValueBinner in project OpenRefine by OpenRefine.
the class TimeRangeFacet method computeChoices.
@Override
public void computeChoices(Project project, FilteredRecords filteredRecords) {
if (_eval != null && _errorMessage == null) {
RowEvaluable rowEvaluable = getRowEvaluable(project);
Column column = project.columnModel.getColumnByCellIndex(_cellIndex);
String key = "time-bin:record-based:" + _expression;
TimeBinIndex index = (TimeBinIndex) column.getPrecompute(key);
if (index == null) {
index = new TimeBinRecordIndex(project, rowEvaluable);
column.setPrecompute(key, index);
}
retrieveDataFromBaseBinIndex(index);
ExpressionTimeValueBinner binner = new ExpressionTimeValueBinner(rowEvaluable, index);
filteredRecords.accept(project, binner);
retrieveDataFromBinner(binner);
}
}
Aggregations