org.apache.sysds.runtime.transform.encode

## Interface Encoder

All Superinterfaces:
  Externalizable, Serializable

All Known Implementing Classes:
  ColumnEncoder, ColumnEncoderBin, ColumnEncoderComposite, ColumnEncoderDummycode, ColumnEncoderFeatureHash, ColumnEncoderPassThrough, ColumnEncoderRecode, MultiColumnEncoder

    public interface Encoder
    extends Externalizable

### Method Summary

All Methods Instance Methods Abstract Methods
`MatrixBlock` `apply(FrameBlock in, MatrixBlock out, int outputCol)` Apply the generated metadata to the FrameBlock and saved the result in out.
`void` `build(FrameBlock in)` Build the transform meta data for the given block input.
`void` `buildPartial(FrameBlock in)` Partial build of internal data structures (e.g., in distributed spark operations).
`FrameBlock` `getMetaData(FrameBlock out)` Construct a frame block out of the transform meta data.
`void` `initMetaData(FrameBlock meta)` Sets up the required meta data for a subsequent call to apply.
`void` `prepareBuildPartial()` Allocates internal data structures for partial build.
`void` `updateIndexRanges(long[] beginDims, long[] endDims, int offset)` Update index-ranges to after encoding.

### Methods inherited from interface java.io.Externalizable

`readExternal, writeExternal`

### Method Detail

#### build

    void build(FrameBlock in)

Build the transform meta data for the given block input. This call modifies and keeps meta data as encoder state.

Parameters:
  `in` - input frame block

#### apply

    MatrixBlock apply(FrameBlock in,
                      MatrixBlock out,
                      int outputCol)

Apply the generated metadata to the FrameBlock and saved the result in out.

Parameters:
  `in` - input frame block
  `out` - output matrix block
  `outputCol` - is a offset in the output matrix. column in FrameBlock + outputCol = column in out
Returns:
  output matrix block

#### getMetaData

    FrameBlock getMetaData(FrameBlock out)

Construct a frame block out of the transform meta data.

Parameters:
  `out` - output frame block
Returns:
  output frame block?

#### initMetaData

    void initMetaData(FrameBlock meta)

Sets up the required meta data for a subsequent call to apply.

Parameters:
  `meta` - frame block

#### prepareBuildPartial

    void prepareBuildPartial()

Allocates internal data structures for partial build.

#### buildPartial

    void buildPartial(FrameBlock in)

Partial build of internal data structures (e.g., in distributed spark operations).

Parameters:
  `in` - input frame block

#### updateIndexRanges

    void updateIndexRanges(long[] beginDims,
                           long[] endDims,
                           int offset)

Update index-ranges to after encoding. Note that only Dummycoding changes the ranges.

Parameters:
  `beginDims` - begin dimensions of range
  `endDims` - end dimensions of range
  `offset` - is applied to begin and endDims