Package org.openrefine.browsing.facets
Class TextSearchFacet.TextSearchAggregator
- java.lang.Object
-
- org.openrefine.browsing.facets.RowInRecordAggregator<T>
-
- org.openrefine.browsing.facets.FacetAggregator<TextSearchFacet.TextSearchFacetState>
-
- org.openrefine.browsing.facets.TextSearchFacet.TextSearchAggregator
-
- All Implemented Interfaces:
Serializable
,Combiner<TextSearchFacet.TextSearchFacetState>
,RecordAggregator<TextSearchFacet.TextSearchFacetState>
,RowAggregator<TextSearchFacet.TextSearchFacetState>
- Enclosing class:
- TextSearchFacet
public static class TextSearchFacet.TextSearchAggregator extends FacetAggregator<TextSearchFacet.TextSearchFacetState>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TextSearchAggregator(Pattern pattern, int cellIndex, TextSearchFacet.TextSearchFacetConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RowInRecordFilter
getRowFilter()
TextSearchFacet.TextSearchFacetState
sum(TextSearchFacet.TextSearchFacetState first, TextSearchFacet.TextSearchFacetState second)
Merges two facet statistics from the same facet, computed on different sets of rows.TextSearchFacet.TextSearchFacetState
withRow(TextSearchFacet.TextSearchFacetState state, long rowId, Row row, Record record)
Adds statistics obtained from a single row to the facet state.-
Methods inherited from class org.openrefine.browsing.facets.FacetAggregator
withRowOutsideView
-
Methods inherited from class org.openrefine.browsing.facets.RowInRecordAggregator
withRecord, withRow
-
-
-
-
Constructor Detail
-
TextSearchAggregator
public TextSearchAggregator(Pattern pattern, int cellIndex, TextSearchFacet.TextSearchFacetConfig config)
-
-
Method Detail
-
withRow
public TextSearchFacet.TextSearchFacetState withRow(TextSearchFacet.TextSearchFacetState state, long rowId, Row row, Record record)
Description copied from class:RowInRecordAggregator
Adds statistics obtained from a single row to the facet state. Given that facet states are expected to be immutable, this returns a new facet state object.- Specified by:
withRow
in classRowInRecordAggregator<TextSearchFacet.TextSearchFacetState>
rowId
- the row id of the row to ingestrow
- the row to ingestrecord
- the enclosing record of the row, if available (in records mode), null otherwise- Returns:
- the facet state updated with this row
-
sum
public TextSearchFacet.TextSearchFacetState sum(TextSearchFacet.TextSearchFacetState first, TextSearchFacet.TextSearchFacetState 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<TextSearchFacet.TextSearchFacetState>
- Returns:
- a row filter which determines if a row matches this facet.
-
-