Class RowMapOperation

    • Constructor Detail

      • RowMapOperation

        protected RowMapOperation​(EngineConfig engineConfig)
    • Method Detail

      • 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 a ChangeData which will be fetched asynchronously.
        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
      • getGridMap

        protected RowMapOperation.GridMap getGridMap​(Grid state,
                                                     ChangeContext context)
                                              throws OperationException
        Returns the function that is applied to each row and row index, the new column model applied to the grid, and the new overlay models. Computing these in one go can be useful in certain situations, for instance when the number of columns added to the column model depends on the data. If a subclass needs to return only one non-default value out of mapper, column model and overlay models it can instead override the corresponding method.
        Parameters:
        state - the initial column model
        Throws:
        OperationException - if the change does not apply to the given grid
      • getNewColumnModel

        protected ColumnModel getNewColumnModel​(Grid state,
                                                ChangeContext context)
                                         throws OperationException
        Returns the column model after the change is applied to the given grid. By default, returns the same column model.
        Parameters:
        state - the grid to which the change should be applied
        Returns:
        the column model of the new grid
        Throws:
        OperationException
      • postTransform

        protected Grid postTransform​(Grid grid,
                                     ChangeContext context)
                              throws OperationException
        Method run at the end of the change to update any statistics (such as ReconStats or overlay models) on the resulting state.
        Parameters:
        grid - the grid after the map operation
        Returns:
        the grid with updated column statistics (or any other post transformation)
        Throws:
        OperationException