Package org.openrefine.browsing.facets
Class StringFacetAggregator
- java.lang.Object
-
- org.openrefine.browsing.facets.RowInRecordAggregator<T>
-
- org.openrefine.browsing.facets.FacetAggregator<StringFacetState>
-
- org.openrefine.browsing.facets.StringFacetAggregator
-
- All Implemented Interfaces:
Serializable,Combiner<StringFacetState>,RecordAggregator<StringFacetState>,RowAggregator<StringFacetState>
public class StringFacetAggregator extends FacetAggregator<StringFacetState>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StringFacetAggregator(int columnIdx, String selected)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RowInRecordFiltergetRowFilter()StringFacetStatesum(StringFacetState first, StringFacetState second)Merges two facet statistics from the same facet, computed on different sets of rows.StringFacetStatewithRow(StringFacetState 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
-
StringFacetAggregator
public StringFacetAggregator(int columnIdx, String selected)
-
-
Method Detail
-
sum
public StringFacetState sum(StringFacetState first, StringFacetState second)
Description copied from interface:CombinerMerges 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
-
withRow
public StringFacetState withRow(StringFacetState state, long rowId, Row row, Record record)
Description copied from class:RowInRecordAggregatorAdds 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:
withRowin classRowInRecordAggregator<StringFacetState>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
-
getRowFilter
public RowInRecordFilter getRowFilter()
- Specified by:
getRowFilterin classFacetAggregator<StringFacetState>- Returns:
- a row filter which determines if a row matches this facet.
-
-