Package org.openrefine.operations.cell
Class FillDownOperation
- java.lang.Object
-
- org.openrefine.operations.EngineDependentOperation
-
- org.openrefine.operations.cell.FillDownOperation
-
- All Implemented Interfaces:
Operation
public class FillDownOperation extends EngineDependentOperation
Transforms a table with a record structure to by spreading non-null values in the rows below, in a specific column.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
_columnName
-
Fields inherited from class org.openrefine.operations.EngineDependentOperation
_engineConfig
-
-
Constructor Summary
Constructors Constructor Description FillDownOperation(EngineConfig engineConfig, String columnName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeResult
apply(Grid state, ChangeContext context)
Derives the new grid state from the current grid state.String
getColumnName()
String
getDescription()
A short human-readable description of what this operation does.protected static RecordMapper
recordMapper(int columnIndex, int keyColumnIndex)
protected static RowScanMapper<Cell>
rowScanMapper(int columnIndex, int keyColumnIndex)
-
Methods inherited from class org.openrefine.operations.EngineDependentOperation
getEngine, getEngineConfig
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openrefine.operations.Operation
getOperationId, isReproducible
-
-
-
-
Field Detail
-
_columnName
protected String _columnName
-
-
Constructor Detail
-
FillDownOperation
public FillDownOperation(EngineConfig engineConfig, String columnName)
-
-
Method Detail
-
apply
public ChangeResult apply(Grid state, ChangeContext context) throws OperationException
Description copied from interface:Operation
Derives the new grid state from the current grid state. Executing this method should be quick (even on large datasets) since it is expected to just derive the new grid from the existing one without actually executing any expensive computation. Long-running computations should rather go in the derivation of aChangeData
which will be fetched asynchronously.- Parameters:
state
- the state of the grid before the change- Returns:
- an object which bundles up various pieces of information produced by the operation: primarily, the new grid after applying the operation. This object can be subclassed to expose more information, which should be serializable with Jackson so that it reaches the frontend.
- Throws:
OperationException
- when the change cannot be applied to the given grid
-
getColumnName
public String getColumnName()
-
getDescription
public String getDescription()
Description copied from interface:Operation
A short human-readable description of what this operation does.
-
recordMapper
protected static RecordMapper recordMapper(int columnIndex, int keyColumnIndex)
-
rowScanMapper
protected static RowScanMapper<Cell> rowScanMapper(int columnIndex, int keyColumnIndex)
-
-