Package org.openrefine.browsing.util
Class TimeRangeFacetAggregator
- java.lang.Object
-
- org.openrefine.browsing.facets.RowInRecordAggregator<T>
-
- org.openrefine.browsing.facets.FacetAggregator<T>
-
- org.openrefine.browsing.util.ExpressionValueFacetAggregator<TimeRangeFacetState>
-
- org.openrefine.browsing.util.TimeRangeFacetAggregator
-
- All Implemented Interfaces:
Serializable
,Combiner<TimeRangeFacetState>
,RecordAggregator<TimeRangeFacetState>
,RowAggregator<TimeRangeFacetState>
public class TimeRangeFacetAggregator extends ExpressionValueFacetAggregator<TimeRangeFacetState>
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.openrefine.browsing.util.ExpressionValueFacetAggregator
_eval, _invert
-
-
Constructor Summary
Constructors Constructor Description TimeRangeFacetAggregator(TimeRangeFacet.TimeRangeFacetConfig config, boolean invert, RowEvaluable eval)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RowInRecordFilter
getRowFilter()
TimeRangeFacetState
sum(TimeRangeFacetState first, TimeRangeFacetState second)
Merges two facet statistics from the same facet, computed on different sets of rows.protected TimeRangeFacetState
withValue(TimeRangeFacetState state, Object value, boolean inView)
Method to be implemented by subclasses to aggregate a value to their state.protected TimeRangeStatistics
withValue(TimeRangeStatistics state, Object value)
-
Methods inherited from class org.openrefine.browsing.util.ExpressionValueFacetAggregator
withRow, withRowOutsideView
-
Methods inherited from class org.openrefine.browsing.facets.RowInRecordAggregator
withRecord, withRow
-
-
-
-
Constructor Detail
-
TimeRangeFacetAggregator
public TimeRangeFacetAggregator(TimeRangeFacet.TimeRangeFacetConfig config, boolean invert, RowEvaluable eval)
-
-
Method Detail
-
sum
public TimeRangeFacetState sum(TimeRangeFacetState first, TimeRangeFacetState 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
-
getRowFilter
public RowInRecordFilter getRowFilter()
- Specified by:
getRowFilter
in classFacetAggregator<TimeRangeFacetState>
- Returns:
- a row filter which determines if a row matches this facet.
-
withValue
protected TimeRangeFacetState withValue(TimeRangeFacetState 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<TimeRangeFacetState>
- 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 TimeRangeStatistics withValue(TimeRangeStatistics state, Object value)
-
-