public abstract class BaseTransform extends Object implements Transform
Transform
implemenation that most transforms can extend.
Any transform that can be implemented as a GlobalTransform
can simply
define the a GlobalTransform
and then subclass this abstract class to
adhere to the standard Transform
interface.Constructor and Description |
---|
BaseTransform() |
Modifier and Type | Method and Description |
---|---|
protected abstract GlobalTransform |
getTransform(File inputMatrixFile,
MatrixIO.Format format)
Returns a
GlobalTransform for a File of the given format. |
protected abstract GlobalTransform |
getTransform(Matrix matrix)
Returns a
GlobalTransform for a Matrix . |
File |
transform(File inputMatrixFile,
MatrixIO.Format format)
Transforms the matrix in the file using the an implemented method and
returns a temporary file containing the result.
|
void |
transform(File inputMatrixFile,
MatrixIO.Format format,
File outputMatrixFile)
Transforms the input matrix using the implemented method and writes the
result to the file for the output matrix.
|
Matrix |
transform(Matrix matrix)
Returns a transformed matrix based on the given matrix.
|
Matrix |
transform(Matrix matrix,
Matrix transformed)
Returns a transformed matrix based on the given matrix.
|
public File transform(File inputMatrixFile, MatrixIO.Format format) throws IOException
transform
in interface Transform
inputMatrixFile
- a file containing a matrix in the specified formatformat
- the format of the matrixIOException
- if any error occurs while reading the input matrix or
writing the output matrixpublic void transform(File inputMatrixFile, MatrixIO.Format format, File outputMatrixFile) throws IOException
transform
in interface Transform
inputMatrixFile
- a file containing a matrix in the specified formatformat
- the format of the input matrix, and the format in
which the output matrix will be writtenoutputMatrixFile
- the file to which the transformed matrix will be
writtenIOException
- if any error occurs while reading the input matrix or
writing the output matrixpublic Matrix transform(Matrix matrix)
public Matrix transform(Matrix matrix, Matrix transformed)
protected abstract GlobalTransform getTransform(Matrix matrix)
GlobalTransform
for a Matrix
.protected abstract GlobalTransform getTransform(File inputMatrixFile, MatrixIO.Format format)
GlobalTransform
for a File of the given format.Copyright © 2012. All Rights Reserved.