public abstract class Encoder extends Object implements Serializable
| Modifier and Type | Method and Description |
|---|---|
abstract MatrixBlock |
apply(FrameBlock in,
MatrixBlock out)
Encode input data blockwise according to existing transform meta
data (transform apply).
|
abstract void |
build(FrameBlock in)
Build the transform meta data for the given block input.
|
abstract MatrixBlock |
encode(FrameBlock in,
MatrixBlock out)
Block encode: build and apply (transform encode).
|
int[] |
getColList() |
MatrixBlock |
getColMapping(FrameBlock meta,
MatrixBlock out)
Obtain the column mapping of encoded frames based on the passed
meta data frame.
|
abstract FrameBlock |
getMetaData(FrameBlock out)
Construct a frame block out of the transform meta data.
|
int |
getNumCols() |
int |
initColList(int[] colList) |
int |
initColList(org.apache.wink.json4j.JSONArray attrs) |
abstract void |
initMetaData(FrameBlock meta)
Sets up the required meta data for a subsequent call to apply.
|
boolean |
isApplicable()
Indicates if this encoder is applicable, i.e, if there is at
least one column to encode.
|
int |
isApplicable(int colID)
Indicates if this encoder is applicable for the given column ID,
i.e., if it is subject to this transformation.
|
void |
mergeAt(Encoder other,
int row,
int col)
Merges another encoder, of a compatible type, in after a certain position.
|
void |
setColList(int[] colList) |
Encoder |
subRangeEncoder(IndexRange ixRange)
Returns a new Encoder that only handles a sub range of columns.
|
void |
updateIndexRanges(long[] beginDims,
long[] endDims)
Update index-ranges to after encoding.
|
public int[] getColList()
public void setColList(int[] colList)
public int getNumCols()
public int initColList(org.apache.wink.json4j.JSONArray attrs)
public int initColList(int[] colList)
public boolean isApplicable()
public int isApplicable(int colID)
colID - column IDpublic abstract MatrixBlock encode(FrameBlock in, MatrixBlock out)
in - input frame blockout - output matrix blockpublic abstract void build(FrameBlock in)
in - input frame blockpublic abstract MatrixBlock apply(FrameBlock in, MatrixBlock out)
in - input frame blockout - output matrix blockpublic Encoder subRangeEncoder(IndexRange ixRange)
ixRange - the range (1-based, begin inclusive, end exclusive)public void mergeAt(Encoder other, int row, int col)
Encoders are compatible with themselves and EncoderComposite is compatible with every
other Encoder.other - the encoder that should be merged inrow - the row where it should be placed (1-based)col - the col where it should be placed (1-based)public void updateIndexRanges(long[] beginDims,
long[] endDims)
beginDims - begin dimensions of rangeendDims - end dimensions of rangepublic abstract FrameBlock getMetaData(FrameBlock out)
out - output frame blockpublic abstract void initMetaData(FrameBlock meta)
meta - frame blockpublic MatrixBlock getColMapping(FrameBlock meta, MatrixBlock out)
meta - meta data frame blockout - output matrixCopyright © 2020 The Apache Software Foundation. All rights reserved.