Re-organization of classes in the browsing.* packages.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@825 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
598258a326
commit
ef2079d0d8
@ -15,8 +15,9 @@ import com.metaweb.gridworks.browsing.facets.ListFacet;
|
||||
import com.metaweb.gridworks.browsing.facets.RangeFacet;
|
||||
import com.metaweb.gridworks.browsing.facets.ScatterplotFacet;
|
||||
import com.metaweb.gridworks.browsing.facets.TextSearchFacet;
|
||||
import com.metaweb.gridworks.browsing.filters.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.RowFilter;
|
||||
import com.metaweb.gridworks.browsing.util.ConjunctiveFilteredRecords;
|
||||
import com.metaweb.gridworks.browsing.util.ConjunctiveFilteredRows;
|
||||
import com.metaweb.gridworks.browsing.util.FilteredRecordsAsFilteredRows;
|
||||
import com.metaweb.gridworks.model.Project;
|
||||
import com.metaweb.gridworks.model.Row;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.metaweb.gridworks.browsing.filters;
|
||||
package com.metaweb.gridworks.browsing;
|
||||
|
||||
import com.metaweb.gridworks.model.Project;
|
||||
import com.metaweb.gridworks.model.Record;
|
@ -1,4 +1,4 @@
|
||||
package com.metaweb.gridworks.browsing.filters;
|
||||
package com.metaweb.gridworks.browsing;
|
||||
|
||||
import com.metaweb.gridworks.model.Project;
|
||||
import com.metaweb.gridworks.model.Row;
|
@ -5,8 +5,8 @@ import org.json.JSONObject;
|
||||
import com.metaweb.gridworks.Jsonizable;
|
||||
import com.metaweb.gridworks.browsing.FilteredRecords;
|
||||
import com.metaweb.gridworks.browsing.FilteredRows;
|
||||
import com.metaweb.gridworks.browsing.filters.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.RowFilter;
|
||||
import com.metaweb.gridworks.browsing.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.RowFilter;
|
||||
import com.metaweb.gridworks.model.Project;
|
||||
|
||||
/**
|
||||
|
@ -12,10 +12,11 @@ import org.json.JSONWriter;
|
||||
import com.metaweb.gridworks.browsing.DecoratedValue;
|
||||
import com.metaweb.gridworks.browsing.FilteredRecords;
|
||||
import com.metaweb.gridworks.browsing.FilteredRows;
|
||||
import com.metaweb.gridworks.browsing.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.RowFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.AnyRowRecordFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.ExpressionEqualRowFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.RowFilter;
|
||||
import com.metaweb.gridworks.browsing.util.ExpressionNominalValueGrouper;
|
||||
import com.metaweb.gridworks.expr.Evaluable;
|
||||
import com.metaweb.gridworks.expr.MetaParser;
|
||||
import com.metaweb.gridworks.expr.ParsingException;
|
||||
@ -172,8 +173,8 @@ public class ListFacet implements Facet {
|
||||
@Override
|
||||
public void computeChoices(Project project, FilteredRows filteredRows) {
|
||||
if (_eval != null && _errorMessage == null) {
|
||||
ExpressionNominalRowGrouper grouper =
|
||||
new ExpressionNominalRowGrouper(_eval, _columnName, _cellIndex);
|
||||
ExpressionNominalValueGrouper grouper =
|
||||
new ExpressionNominalValueGrouper(_eval, _columnName, _cellIndex);
|
||||
|
||||
filteredRows.accept(project, grouper);
|
||||
|
||||
@ -184,8 +185,8 @@ public class ListFacet implements Facet {
|
||||
@Override
|
||||
public void computeChoices(Project project, FilteredRecords filteredRecords) {
|
||||
if (_eval != null && _errorMessage == null) {
|
||||
ExpressionNominalRowGrouper grouper =
|
||||
new ExpressionNominalRowGrouper(_eval, _columnName, _cellIndex);
|
||||
ExpressionNominalValueGrouper grouper =
|
||||
new ExpressionNominalValueGrouper(_eval, _columnName, _cellIndex);
|
||||
|
||||
filteredRecords.accept(project, grouper);
|
||||
|
||||
@ -193,7 +194,7 @@ public class ListFacet implements Facet {
|
||||
}
|
||||
}
|
||||
|
||||
protected void postProcessGrouper(ExpressionNominalRowGrouper grouper) {
|
||||
protected void postProcessGrouper(ExpressionNominalValueGrouper grouper) {
|
||||
_choices.clear();
|
||||
_choices.addAll(grouper.choices.values());
|
||||
|
||||
|
@ -8,10 +8,14 @@ import org.json.JSONWriter;
|
||||
|
||||
import com.metaweb.gridworks.browsing.FilteredRecords;
|
||||
import com.metaweb.gridworks.browsing.FilteredRows;
|
||||
import com.metaweb.gridworks.browsing.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.RowFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.AnyRowRecordFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.ExpressionNumberComparisonRowFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.RowFilter;
|
||||
import com.metaweb.gridworks.browsing.util.ExpressionNumericValueBinner;
|
||||
import com.metaweb.gridworks.browsing.util.NumericBinIndex;
|
||||
import com.metaweb.gridworks.browsing.util.NumericBinRecordIndex;
|
||||
import com.metaweb.gridworks.browsing.util.NumericBinRowIndex;
|
||||
import com.metaweb.gridworks.expr.Evaluable;
|
||||
import com.metaweb.gridworks.expr.MetaParser;
|
||||
import com.metaweb.gridworks.expr.ParsingException;
|
||||
@ -187,8 +191,8 @@ public class RangeFacet implements Facet {
|
||||
|
||||
retrieveDataFromBaseBinIndex(index);
|
||||
|
||||
ExpressionNumericRowBinner binner =
|
||||
new ExpressionNumericRowBinner(_eval, _columnName, _cellIndex, index);
|
||||
ExpressionNumericValueBinner binner =
|
||||
new ExpressionNumericValueBinner(_eval, _columnName, _cellIndex, index);
|
||||
|
||||
filteredRows.accept(project, binner);
|
||||
retrieveDataFromBinner(binner);
|
||||
@ -208,8 +212,8 @@ public class RangeFacet implements Facet {
|
||||
|
||||
retrieveDataFromBaseBinIndex(index);
|
||||
|
||||
ExpressionNumericRowBinner binner =
|
||||
new ExpressionNumericRowBinner(_eval, _columnName, _cellIndex, index);
|
||||
ExpressionNumericValueBinner binner =
|
||||
new ExpressionNumericValueBinner(_eval, _columnName, _cellIndex, index);
|
||||
|
||||
filteredRecords.accept(project, binner);
|
||||
|
||||
@ -237,7 +241,7 @@ public class RangeFacet implements Facet {
|
||||
}
|
||||
}
|
||||
|
||||
protected void retrieveDataFromBinner(ExpressionNumericRowBinner binner) {
|
||||
protected void retrieveDataFromBinner(ExpressionNumericValueBinner binner) {
|
||||
_bins = binner.bins;
|
||||
_numericCount = binner.numericCount;
|
||||
_nonNumericCount = binner.nonNumericCount;
|
||||
|
@ -20,10 +20,13 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.metaweb.gridworks.browsing.FilteredRecords;
|
||||
import com.metaweb.gridworks.browsing.FilteredRows;
|
||||
import com.metaweb.gridworks.browsing.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.RowFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.AnyRowRecordFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.DualExpressionsNumberComparisonRowFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.RowFilter;
|
||||
import com.metaweb.gridworks.browsing.util.NumericBinIndex;
|
||||
import com.metaweb.gridworks.browsing.util.NumericBinRecordIndex;
|
||||
import com.metaweb.gridworks.browsing.util.NumericBinRowIndex;
|
||||
import com.metaweb.gridworks.expr.Evaluable;
|
||||
import com.metaweb.gridworks.expr.MetaParser;
|
||||
import com.metaweb.gridworks.expr.ParsingException;
|
||||
|
@ -9,10 +9,10 @@ import org.json.JSONWriter;
|
||||
|
||||
import com.metaweb.gridworks.browsing.FilteredRecords;
|
||||
import com.metaweb.gridworks.browsing.FilteredRows;
|
||||
import com.metaweb.gridworks.browsing.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.RowFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.AnyRowRecordFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.ExpressionStringComparisonRowFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.filters.RowFilter;
|
||||
import com.metaweb.gridworks.expr.Evaluable;
|
||||
import com.metaweb.gridworks.gel.ast.VariableExpr;
|
||||
import com.metaweb.gridworks.model.Project;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.metaweb.gridworks.browsing.filters;
|
||||
|
||||
import com.metaweb.gridworks.browsing.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.RowFilter;
|
||||
import com.metaweb.gridworks.model.Project;
|
||||
import com.metaweb.gridworks.model.Record;
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.metaweb.gridworks.browsing.filters;
|
||||
import java.util.Collection;
|
||||
import java.util.Properties;
|
||||
|
||||
import com.metaweb.gridworks.browsing.RowFilter;
|
||||
import com.metaweb.gridworks.expr.Evaluable;
|
||||
import com.metaweb.gridworks.expr.ExpressionUtils;
|
||||
import com.metaweb.gridworks.model.Cell;
|
||||
|
@ -3,6 +3,7 @@ package com.metaweb.gridworks.browsing.filters;
|
||||
import java.util.Collection;
|
||||
import java.util.Properties;
|
||||
|
||||
import com.metaweb.gridworks.browsing.RowFilter;
|
||||
import com.metaweb.gridworks.expr.Evaluable;
|
||||
import com.metaweb.gridworks.expr.ExpressionUtils;
|
||||
import com.metaweb.gridworks.model.Cell;
|
||||
|
@ -3,6 +3,7 @@ package com.metaweb.gridworks.browsing.filters;
|
||||
import java.util.Collection;
|
||||
import java.util.Properties;
|
||||
|
||||
import com.metaweb.gridworks.browsing.RowFilter;
|
||||
import com.metaweb.gridworks.expr.Evaluable;
|
||||
import com.metaweb.gridworks.expr.ExpressionUtils;
|
||||
import com.metaweb.gridworks.model.Cell;
|
||||
|
@ -2,6 +2,7 @@ package com.metaweb.gridworks.browsing.filters;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import com.metaweb.gridworks.browsing.RowFilter;
|
||||
import com.metaweb.gridworks.expr.Evaluable;
|
||||
import com.metaweb.gridworks.expr.ExpressionUtils;
|
||||
import com.metaweb.gridworks.model.Cell;
|
||||
|
@ -1,9 +1,11 @@
|
||||
package com.metaweb.gridworks.browsing;
|
||||
package com.metaweb.gridworks.browsing.util;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.metaweb.gridworks.browsing.filters.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.FilteredRecords;
|
||||
import com.metaweb.gridworks.browsing.RecordFilter;
|
||||
import com.metaweb.gridworks.browsing.RecordVisitor;
|
||||
import com.metaweb.gridworks.model.Project;
|
||||
import com.metaweb.gridworks.model.Record;
|
||||
|
@ -1,9 +1,11 @@
|
||||
package com.metaweb.gridworks.browsing;
|
||||
package com.metaweb.gridworks.browsing.util;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.metaweb.gridworks.browsing.filters.RowFilter;
|
||||
import com.metaweb.gridworks.browsing.FilteredRows;
|
||||
import com.metaweb.gridworks.browsing.RowFilter;
|
||||
import com.metaweb.gridworks.browsing.RowVisitor;
|
||||
import com.metaweb.gridworks.model.Project;
|
||||
import com.metaweb.gridworks.model.Row;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.metaweb.gridworks.browsing.facets;
|
||||
package com.metaweb.gridworks.browsing.util;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@ -8,6 +8,7 @@ import java.util.Properties;
|
||||
import com.metaweb.gridworks.browsing.DecoratedValue;
|
||||
import com.metaweb.gridworks.browsing.RecordVisitor;
|
||||
import com.metaweb.gridworks.browsing.RowVisitor;
|
||||
import com.metaweb.gridworks.browsing.facets.NominalFacetChoice;
|
||||
import com.metaweb.gridworks.expr.Evaluable;
|
||||
import com.metaweb.gridworks.expr.ExpressionUtils;
|
||||
import com.metaweb.gridworks.model.Cell;
|
||||
@ -16,10 +17,10 @@ import com.metaweb.gridworks.model.Record;
|
||||
import com.metaweb.gridworks.model.Row;
|
||||
|
||||
/**
|
||||
* Visit matched rows and group them into facet choices based on the values computed
|
||||
* Visit matched rows or records and group them into facet choices based on the values computed
|
||||
* from a given expression.
|
||||
*/
|
||||
public class ExpressionNominalRowGrouper implements RowVisitor, RecordVisitor {
|
||||
public class ExpressionNominalValueGrouper implements RowVisitor, RecordVisitor {
|
||||
static public class IndexedNominalFacetChoice extends NominalFacetChoice {
|
||||
int _latestIndex;
|
||||
|
||||
@ -42,10 +43,14 @@ public class ExpressionNominalRowGrouper implements RowVisitor, RecordVisitor {
|
||||
final public Map<Object, IndexedNominalFacetChoice> choices = new HashMap<Object, IndexedNominalFacetChoice>();
|
||||
public int blankCount = 0;
|
||||
public int errorCount = 0;
|
||||
|
||||
/*
|
||||
* Scratch pad variables
|
||||
*/
|
||||
protected boolean hasBlank;
|
||||
protected boolean hasError;
|
||||
|
||||
public ExpressionNominalRowGrouper(Evaluable evaluable, String columnName, int cellIndex) {
|
||||
public ExpressionNominalValueGrouper(Evaluable evaluable, String columnName, int cellIndex) {
|
||||
_evaluable = evaluable;
|
||||
_columnName = columnName;
|
||||
_cellIndex = cellIndex;
|
@ -1,4 +1,4 @@
|
||||
package com.metaweb.gridworks.browsing.facets;
|
||||
package com.metaweb.gridworks.browsing.util;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Properties;
|
||||
@ -13,10 +13,10 @@ import com.metaweb.gridworks.model.Record;
|
||||
import com.metaweb.gridworks.model.Row;
|
||||
|
||||
/**
|
||||
* Visit matched rows and slot them into bins based on the numbers computed
|
||||
* Visit matched rows or records and slot them into bins based on the numbers computed
|
||||
* from a given expression.
|
||||
*/
|
||||
public class ExpressionNumericRowBinner implements RowVisitor, RecordVisitor {
|
||||
public class ExpressionNumericValueBinner implements RowVisitor, RecordVisitor {
|
||||
/*
|
||||
* Configuration
|
||||
*/
|
||||
@ -42,7 +42,7 @@ public class ExpressionNumericRowBinner implements RowVisitor, RecordVisitor {
|
||||
protected boolean hasNumeric;
|
||||
protected boolean hasNonNumeric;
|
||||
|
||||
public ExpressionNumericRowBinner(Evaluable evaluable, String columnName, int cellIndex, NumericBinIndex index) {
|
||||
public ExpressionNumericValueBinner(Evaluable evaluable, String columnName, int cellIndex, NumericBinIndex index) {
|
||||
_evaluable = evaluable;
|
||||
_columnName = columnName;
|
||||
_cellIndex = cellIndex;
|
@ -1,5 +1,8 @@
|
||||
package com.metaweb.gridworks.browsing;
|
||||
package com.metaweb.gridworks.browsing.util;
|
||||
|
||||
import com.metaweb.gridworks.browsing.FilteredRecords;
|
||||
import com.metaweb.gridworks.browsing.FilteredRows;
|
||||
import com.metaweb.gridworks.browsing.RowVisitor;
|
||||
import com.metaweb.gridworks.model.Project;
|
||||
|
||||
public class FilteredRecordsAsFilteredRows implements FilteredRows {
|
@ -1,4 +1,4 @@
|
||||
package com.metaweb.gridworks.browsing.facets;
|
||||
package com.metaweb.gridworks.browsing.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
@ -1,4 +1,4 @@
|
||||
package com.metaweb.gridworks.browsing.facets;
|
||||
package com.metaweb.gridworks.browsing.util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
@ -1,4 +1,4 @@
|
||||
package com.metaweb.gridworks.browsing.facets;
|
||||
package com.metaweb.gridworks.browsing.util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
@ -1,5 +1,7 @@
|
||||
package com.metaweb.gridworks.browsing;
|
||||
package com.metaweb.gridworks.browsing.util;
|
||||
|
||||
import com.metaweb.gridworks.browsing.RecordVisitor;
|
||||
import com.metaweb.gridworks.browsing.RowVisitor;
|
||||
import com.metaweb.gridworks.model.Project;
|
||||
import com.metaweb.gridworks.model.Record;
|
||||
|
@ -18,9 +18,9 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.metaweb.gridworks.browsing.Engine;
|
||||
import com.metaweb.gridworks.browsing.FilteredRows;
|
||||
import com.metaweb.gridworks.browsing.facets.NumericBinIndex;
|
||||
import com.metaweb.gridworks.browsing.facets.ScatterplotDrawingRowVisitor;
|
||||
import com.metaweb.gridworks.browsing.facets.ScatterplotFacet;
|
||||
import com.metaweb.gridworks.browsing.util.NumericBinIndex;
|
||||
import com.metaweb.gridworks.commands.Command;
|
||||
import com.metaweb.gridworks.expr.Evaluable;
|
||||
import com.metaweb.gridworks.expr.MetaParser;
|
||||
|
@ -9,8 +9,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONWriter;
|
||||
|
||||
import com.metaweb.gridworks.browsing.facets.NumericBinIndex;
|
||||
import com.metaweb.gridworks.browsing.facets.NumericBinRowIndex;
|
||||
import com.metaweb.gridworks.browsing.util.NumericBinIndex;
|
||||
import com.metaweb.gridworks.browsing.util.NumericBinRowIndex;
|
||||
import com.metaweb.gridworks.commands.Command;
|
||||
import com.metaweb.gridworks.expr.Evaluable;
|
||||
import com.metaweb.gridworks.expr.MetaParser;
|
||||
|
Loading…
Reference in New Issue
Block a user