public abstract class AbstractMojoWriter
extends java.lang.Object
Constructor and Description |
---|
AbstractMojoWriter(ModelDescriptor model) |
Modifier and Type | Method and Description |
---|---|
protected void |
finishWritingTextFile()
Finish writing a text file.
|
abstract java.lang.String |
mojoVersion()
Version of the mojo file produced.
|
protected void |
startWritingTextFile(java.lang.String filename)
Write a text file to the MOJO archive (or rather open such file for writing).
|
protected void |
write(IsotonicCalibrator calibrator) |
protected void |
writeblob(java.lang.String filename,
byte[] blob)
Write a binary file to the MOJO archive.
|
protected void |
writeDomains()
Create files containing domain definitions for each categorical column.
|
protected void |
writeExtraInfo() |
protected void |
writekv(java.lang.String key,
double[] value) |
protected void |
writekv(java.lang.String key,
float[] value) |
protected void |
writekv(java.lang.String key,
int[] value) |
protected void |
writekv(java.lang.String key,
java.lang.Object value)
Write a simple value to the model.ini/[info] section.
|
protected void |
writeln(java.lang.String s)
Write a single line of text to a previously opened text file.
|
protected void |
writeln(java.lang.String s,
boolean escapeNewlines)
Write a single line of text to a previously opened text file, escape new line characters if enabled.
|
protected void |
writelnkv(java.lang.String key,
java.lang.String value) |
protected abstract void |
writeModelData()
Override in subclasses to write the actual model data.
|
protected void |
writeStringArray(java.lang.String[] array,
java.lang.String filename) |
protected void |
writeTo(java.util.zip.ZipOutputStream zos) |
void |
writeTo(java.util.zip.ZipOutputStream zos,
java.lang.String zipDirectory) |
public AbstractMojoWriter(ModelDescriptor model)
public abstract java.lang.String mojoVersion()
major.minor
format, where minor
is a 2-digit number. For example "1.00",
"2.05", "2.13". See README in mojoland repository for more details.protected abstract void writeModelData() throws java.io.IOException
java.io.IOException
protected final void writekv(java.lang.String key, java.lang.Object value) throws java.io.IOException
java.io.IOException
protected final void writekv(java.lang.String key, int[] value) throws java.io.IOException
java.io.IOException
protected final void writekv(java.lang.String key, double[] value) throws java.io.IOException
java.io.IOException
protected final void writekv(java.lang.String key, float[] value) throws java.io.IOException
java.io.IOException
protected final void write(IsotonicCalibrator calibrator) throws java.io.IOException
java.io.IOException
protected final void writeblob(java.lang.String filename, byte[] blob) throws java.io.IOException
java.io.IOException
protected final void startWritingTextFile(java.lang.String filename)
protected final void writeln(java.lang.String s, boolean escapeNewlines)
protected void writelnkv(java.lang.String key, java.lang.String value)
protected final void writeln(java.lang.String s)
protected final void finishWritingTextFile() throws java.io.IOException
java.io.IOException
protected void writeTo(java.util.zip.ZipOutputStream zos) throws java.io.IOException
java.io.IOException
public final void writeTo(java.util.zip.ZipOutputStream zos, java.lang.String zipDirectory) throws java.io.IOException
java.io.IOException
protected void writeExtraInfo() throws java.io.IOException
java.io.IOException
protected void writeDomains() throws java.io.IOException
java.io.IOException
protected void writeStringArray(java.lang.String[] array, java.lang.String filename) throws java.io.IOException
java.io.IOException