Package org.openrefine.operations.cell
Class CellEditOperation
- java.lang.Object
 - 
- org.openrefine.operations.cell.CellEditOperation
 
 
- 
- 
Constructor Summary
Constructors Constructor Description CellEditOperation(long row, String columnName, Object newCellValue, String type) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeResultapply(Grid projectState, ChangeContext context)Derives the new grid state from the current grid state.StringgetColumnName()The name of the column where the cell is changed.StringgetDescription()A short human-readable description of what this operation does.SerializablegetNewCellValue()The new value of the cell to use.longgetRowId()The 0-based id of the affected row.StringgetType()booleanisReproducible()Could this operation be meaningfully re-applied to another project, or is it too specific to the data in this project?protected static RowMappermapFunction(int cellIndex, long rowId, Serializable newCellValue, int keyColumnIndex)- 
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 
 - 
 
 - 
 
- 
- 
Method Detail
- 
apply
public ChangeResult apply(Grid projectState, ChangeContext context) throws OperationException
Description copied from interface:OperationDerives 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 aChangeDatawhich will be fetched asynchronously.- Specified by:
 applyin interfaceOperation- Parameters:
 projectState- 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
 
- 
mapFunction
protected static RowMapper mapFunction(int cellIndex, long rowId, Serializable newCellValue, int keyColumnIndex)
 
- 
getDescription
public String getDescription()
Description copied from interface:OperationA short human-readable description of what this operation does.- Specified by:
 getDescriptionin interfaceOperation
 
- 
isReproducible
public boolean isReproducible()
Description copied from interface:OperationCould this operation be meaningfully re-applied to another project, or is it too specific to the data in this project? Operations which affect a single row or cell designated by a row index should return false, indicating that they are small fixes that should likely not be part of a reusable pipeline.- Specified by:
 isReproduciblein interfaceOperation
 
- 
getRowId
public long getRowId()
The 0-based id of the affected row. 
- 
getColumnName
public String getColumnName()
The name of the column where the cell is changed. 
- 
getNewCellValue
public Serializable getNewCellValue()
The new value of the cell to use. 
- 
getType
public String getType()
 
 - 
 
 -