Package org.openrefine.operations.cell
Class ReconEditOperation
- java.lang.Object
-
- org.openrefine.operations.cell.ReconEditOperation
-
-
Constructor Summary
Constructors Constructor Description ReconEditOperation(long rowId, String columnName, Recon.Judgment judgment, String identifierSpace, String schemaSpace, ReconCandidate match, String cellValue)
-
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
getCellValue()
The value of the cell in which this recon change is happening.String
getColumnName()
The name of the column in which the cell can be found.String
getDescription()
A short human-readable description of what this operation does.String
getIdentifierSpace()
The identifier space of the recon object.Recon.Judgment
getJudgment()
The judgment to set on the recon.ReconCandidate
getMatch()
long
getRowId()
The 0-based index of the row to change.String
getSchemaSpace()
The schema space of the recon object.boolean
isReproducible()
Could this operation be meaningfully re-applied to another project, or is it too specific to the data in this project?protected static RowMapper
mapFunction(int cellIndex, long rowId, Recon newRecon)
-
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
-
-
-
-
Constructor Detail
-
ReconEditOperation
public ReconEditOperation(long rowId, String columnName, Recon.Judgment judgment, String identifierSpace, String schemaSpace, ReconCandidate match, String cellValue)
-
-
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.- Specified by:
apply
in interfaceOperation
- 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
-
getDescription
public String getDescription()
Description copied from interface:Operation
A short human-readable description of what this operation does.- Specified by:
getDescription
in interfaceOperation
-
isReproducible
public boolean isReproducible()
Description copied from interface:Operation
Could 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:
isReproducible
in interfaceOperation
-
getRowId
public long getRowId()
The 0-based index of the row to change.
-
getColumnName
public String getColumnName()
The name of the column in which the cell can be found.
-
getJudgment
public Recon.Judgment getJudgment()
The judgment to set on the recon.
-
getIdentifierSpace
public String getIdentifierSpace()
The identifier space of the recon object.
-
getSchemaSpace
public String getSchemaSpace()
The schema space of the recon object.
-
getMatch
public ReconCandidate getMatch()
-
getCellValue
public String getCellValue()
The value of the cell in which this recon change is happening. It is only used to generate the operation description.
-
-