Package org.openrefine.browsing.util
Class NumericFacetAggregator
- java.lang.Object
-
- org.openrefine.browsing.facets.RowInRecordAggregator<T>
-
- org.openrefine.browsing.facets.FacetAggregator<T>
-
- org.openrefine.browsing.util.ExpressionValueFacetAggregator<NumericFacetState>
-
- org.openrefine.browsing.util.NumericFacetAggregator
-
- All Implemented Interfaces:
Serializable
,Combiner<NumericFacetState>
,RecordAggregator<NumericFacetState>
,RowAggregator<NumericFacetState>
public class NumericFacetAggregator extends ExpressionValueFacetAggregator<NumericFacetState>
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.openrefine.browsing.util.ExpressionValueFacetAggregator
_eval, _invert
-
-
Constructor Summary
Constructors Constructor Description NumericFacetAggregator(int maxBinCount, RowEvaluable rowEvaluable, double from, double to, boolean selectNumeric, boolean selectNonNumeric, boolean selectBlank, boolean selectError, boolean invert, boolean selected)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RowInRecordFilter
getRowFilter()
HistogramState
sum(HistogramState first, HistogramState second)
NumericFacetState
sum(NumericFacetState first, NumericFacetState second)
Merges two facet statistics from the same facet, computed on different sets of rows.protected HistogramState
withValue(HistogramState state, Object value)
protected NumericFacetState
withValue(NumericFacetState state, Object value, boolean inView)
Method to be implemented by subclasses to aggregate a value to their state.-
Methods inherited from class org.openrefine.browsing.util.ExpressionValueFacetAggregator
withRow, withRowOutsideView
-
Methods inherited from class org.openrefine.browsing.facets.RowInRecordAggregator
withRecord, withRow
-
-
-
-
Constructor Detail
-
NumericFacetAggregator
public NumericFacetAggregator(int maxBinCount, RowEvaluable rowEvaluable, double from, double to, boolean selectNumeric, boolean selectNonNumeric, boolean selectBlank, boolean selectError, boolean invert, boolean selected)
-
-
Method Detail
-
sum
public NumericFacetState sum(NumericFacetState first, NumericFacetState second)
Description copied from interface:Combiner
Merges two facet statistics from the same facet, computed on different sets of rows. This generally amounts to summing all the statistics internally. This function is required to be associative: sum(a, sum(b, c)) == sum(sum(a, b), c)- Returns:
- the sum of both facet statistics
-
withValue
protected NumericFacetState withValue(NumericFacetState state, Object value, boolean inView)
Description copied from class:ExpressionValueFacetAggregator
Method to be implemented by subclasses to aggregate a value to their state. The value is guaranteed not to be a collection, it can be aggregated as such.- Specified by:
withValue
in classExpressionValueFacetAggregator<NumericFacetState>
- Parameters:
state
- the current aggregation statevalue
- the value to aggregateinView
- whether the value is in view (in the rows selected by other facets) or not.- Returns:
- the new aggregation state
-
withValue
protected HistogramState withValue(HistogramState state, Object value)
-
sum
public HistogramState sum(HistogramState first, HistogramState second)
-
getRowFilter
public RowInRecordFilter getRowFilter()
- Specified by:
getRowFilter
in classFacetAggregator<NumericFacetState>
- Returns:
- a row filter which determines if a row matches this facet.
-
-