Package com.google.refine.browsing.util
Class NumericBinIndex
java.lang.Object
com.google.refine.browsing.util.NumericBinIndex
- Direct Known Subclasses:
NumericBinRecordIndex,NumericBinRowIndex
A utility class for computing the base bins that form the base histograms of numeric range facets. It evaluates an
expression on all the rows of a project to get numeric values, determines how many bins to distribute those values
in, and bins the rows accordingly.
This class processes all rows rather than just the filtered rows because it needs to compute the base bins of a
numeric range facet, which remain unchanged as the user interacts with the facet.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int[]protected intprotected intprotected booleanprotected booleanprotected booleanprotected booleanprotected doubleprotected doubleprotected intprotected intprotected intprotected doubleprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]getBins()intintdoublegetMax()doublegetMin()intintdoublegetStep()booleanprotected abstract voiditerate(Project project, RowEvaluable rowEvaluable, List<Double> allValues) protected voidprotected voidprotected voidprocessRow(Project project, RowEvaluable rowEvaluable, List<Double> allValues, int rowIndex, Row row, Properties bindings) protected booleanprocessValue(double v, List<Double> allValues)
-
Field Details
-
_totalValueCount
protected int _totalValueCount -
_numbericValueCount
protected int _numbericValueCount -
_min
protected double _min -
_max
protected double _max -
_step
protected double _step -
_bins
protected int[] _bins -
_numericRowCount
protected int _numericRowCount -
_nonNumericRowCount
protected int _nonNumericRowCount -
_blankRowCount
protected int _blankRowCount -
_errorRowCount
protected int _errorRowCount -
_hasError
protected boolean _hasError -
_hasNonNumeric
protected boolean _hasNonNumeric -
_hasNumeric
protected boolean _hasNumeric -
_hasBlank
protected boolean _hasBlank
-
-
Constructor Details
-
NumericBinIndex
-
-
Method Details
-
iterate
-
isNumeric
public boolean isNumeric() -
getMin
public double getMin() -
getMax
public double getMax() -
getStep
public double getStep() -
getBins
public int[] getBins() -
getNumericRowCount
public int getNumericRowCount() -
getNonNumericRowCount
public int getNonNumericRowCount() -
getBlankRowCount
public int getBlankRowCount() -
getErrorRowCount
public int getErrorRowCount() -
processRow
protected void processRow(Project project, RowEvaluable rowEvaluable, List<Double> allValues, int rowIndex, Row row, Properties bindings) -
preprocessing
protected void preprocessing() -
postprocessing
protected void postprocessing() -
processValue
-