M
- model class that your ModelMojoWriter serializesP
- model parameters class that corresponds to your modelO
- model output class that corresponds to your modelpublic abstract class ModelMojoWriter<M extends Model<M,P,O>,P extends Model.Parameters,O extends Model.Output> extends hex.genmodel.AbstractMojoWriter implements StreamWriter
writeModelData()
. Within
this function you can use any of the following:
AbstractMojoWriter.writekv(String, Object)
to serialize any "simple" values (those that can be represented as a
single-line string).AbstractMojoWriter.writeblob(String, byte[])
to add arbitrary blobs of data to the archive.AbstractMojoWriter.startWritingTextFile(String)
/ AbstractMojoWriter.writeln(String)
/ AbstractMojoWriter.finishWritingTextFile()
to
add text files to the archive.Model.getMojo()
method in your model's class to
return an instance of your new child class.Constructor and Description |
---|
ModelMojoWriter() |
ModelMojoWriter(M model) |
Modifier and Type | Method and Description |
---|---|
void |
write2DArray(double[][] array,
java.lang.String title) |
void |
write2DStringArrays(java.lang.String[][] sArrays,
java.lang.String title) |
void |
write3DArray(double[][][] array,
java.lang.String title) |
void |
write3DIntArray(int[][][] array,
java.lang.String title) |
void |
writeDoubleArray(double[][] array,
java.lang.String title) |
protected void |
writeExtraInfo() |
protected abstract void |
writeModelData() |
void |
writeRectangularDoubleArray(double[][] array,
java.lang.String title) |
void |
writeStringArrays(java.lang.String[] sArrays,
java.lang.String title) |
void |
writeTo(java.io.OutputStream os,
StreamWriteOption... option)
Used from `ModelsHandler.fetchMojo()` to serialize the Mojo into a StreamingSchema.
|
public ModelMojoWriter()
public ModelMojoWriter(M model)
public void writeTo(java.io.OutputStream os, StreamWriteOption... option)
writeTo
in interface StreamWriter
os
- output stream provided by frameworkprotected abstract void writeModelData() throws java.io.IOException
writeModelData
in class hex.genmodel.AbstractMojoWriter
java.io.IOException
protected void writeExtraInfo() throws java.io.IOException
writeExtraInfo
in class hex.genmodel.AbstractMojoWriter
java.io.IOException
public void writeStringArrays(java.lang.String[] sArrays, java.lang.String title) throws java.io.IOException
java.io.IOException
public void writeRectangularDoubleArray(double[][] array, java.lang.String title) throws java.io.IOException
java.io.IOException
public void writeDoubleArray(double[][] array, java.lang.String title) throws java.io.IOException
java.io.IOException
public void write2DStringArrays(java.lang.String[][] sArrays, java.lang.String title) throws java.io.IOException
java.io.IOException
public void write2DArray(double[][] array, java.lang.String title) throws java.io.IOException
java.io.IOException
public void write3DIntArray(int[][][] array, java.lang.String title) throws java.io.IOException
java.io.IOException
public void write3DArray(double[][][] array, java.lang.String title) throws java.io.IOException
java.io.IOException