Package org.openrefine.browsing.facets
Class RowInRecordAggregator<T extends FacetState>
- java.lang.Object
-
- org.openrefine.browsing.facets.RowInRecordAggregator<T>
-
- All Implemented Interfaces:
Serializable
,Combiner<T>
,RecordAggregator<T>
,RowAggregator<T>
- Direct Known Subclasses:
AllFacetsAggregator
,FacetAggregator
public abstract class RowInRecordAggregator<T extends FacetState> extends Object implements RowAggregator<T>, RecordAggregator<T>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RowInRecordAggregator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
withRecord(T state, Record record)
Adds statistics obtained from a single record to the aggregation state.T
withRow(T state, long rowId, Row row)
Adds statistics obtained from a single row to the aggregation state.abstract T
withRow(T state, long rowId, Row row, Record record)
Adds statistics obtained from a single row to the facet state.
-
-
-
Method Detail
-
withRow
public abstract T withRow(T state, long rowId, Row row, Record record)
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.- Parameters:
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
-
withRow
public T withRow(T state, long rowId, Row row)
Description copied from interface:RowAggregator
Adds statistics obtained from a single row to the aggregation state. Given that states are expected to be immutable, this returns a aggregation state object. This function is required to be associative with the combining function: combine(a, withRow(b, rowId, row)) == withRow(combine(a, b), rowId, row)- Specified by:
withRow
in interfaceRowAggregator<T extends FacetState>
rowId
- the row id of the row to ingestrow
- the row to ingest- Returns:
- the aggregation state updated with this row
-
withRecord
public T withRecord(T state, Record record)
Description copied from interface:RecordAggregator
Adds statistics obtained from a single record to the aggregation state. Given that states are expected to be immutable, this returns a new aggregation state object. This function is required to be associative with the combining function: combine(a, withRecord(b, record)) == withRecord(combine(a, b), record)- Specified by:
withRecord
in interfaceRecordAggregator<T extends FacetState>
- Parameters:
state
- the current aggregation staterecord
- the record to ingest- Returns:
- the aggregation state updated with this row
-
-