Package org.openrefine.operations.cell
Class TransposeColumnsIntoRowsOperation
- java.lang.Object
-
- org.openrefine.operations.cell.TransposeColumnsIntoRowsOperation
-
-
Field Summary
Fields Modifier and Type Field Description protected int
_columnCount
protected String
_combinedColumnName
protected boolean
_fillDown
protected boolean
_ignoreBlankCells
protected String
_keyColumnName
protected boolean
_prependColumnName
protected String
_separator
protected String
_startColumnName
protected String
_valueColumnName
-
Constructor Summary
Constructors Constructor Description TransposeColumnsIntoRowsOperation(String startColumnName, int columnCount, boolean ignoreBlankCells, boolean fillDown, String combinedColumnName, boolean prependColumnName, String separator)
TransposeColumnsIntoRowsOperation(String startColumnName, int columnCount, boolean ignoreBlankCells, boolean fillDown, String keyColumnName, String valueColumnName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeResult
apply(Grid projectState, ChangeContext context)
Derives the new grid state from the current grid state.static TransposeColumnsIntoRowsOperation
deserialize(String combinedColumnName, String startColumnName, int columnCount, Boolean ignoreBlankCells, Boolean fillDown, boolean prependColumnName, String separator, String keyColumnName, String valueColumnName)
String
getDescription()
A short human-readable description of what this operation does.Boolean
getPrependColumnName()
-
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
-
_startColumnName
protected final String _startColumnName
-
_columnCount
protected final int _columnCount
-
_ignoreBlankCells
protected final boolean _ignoreBlankCells
-
_fillDown
protected final boolean _fillDown
-
_combinedColumnName
protected final String _combinedColumnName
-
_prependColumnName
protected final boolean _prependColumnName
-
_separator
protected final String _separator
-
_keyColumnName
protected final String _keyColumnName
-
_valueColumnName
protected final String _valueColumnName
-
-
Method Detail
-
getPrependColumnName
public Boolean getPrependColumnName()
-
deserialize
public static TransposeColumnsIntoRowsOperation deserialize(String combinedColumnName, String startColumnName, int columnCount, Boolean ignoreBlankCells, Boolean fillDown, boolean prependColumnName, String separator, String keyColumnName, String valueColumnName)
-
apply
public ChangeResult apply(Grid projectState, 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:
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
-
getDescription
public String getDescription()
Description copied from interface:Operation
A short human-readable description of what this operation does.- Specified by:
getDescription
in interfaceOperation
-
-