Package opennlp.tools.ml.model
Class AbstractModelWriter
- java.lang.Object
-
- opennlp.tools.ml.model.AbstractModelWriter
-
- Direct Known Subclasses:
GenericModelWriter
,GISModelWriter
,NaiveBayesModelWriter
,PerceptronModelWriter
public abstract class AbstractModelWriter extends Object
An abstract, basic implementation of a model writer.
-
-
Constructor Summary
Constructors Constructor Description AbstractModelWriter()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
close()
Closes the underlyingDataOutputStream
.abstract void
persist()
Serializes themodel
using thewriteUTF(String)
,writeDouble(double)
, orwriteInt(int)
} methods implemented by extending classes.abstract void
writeDouble(double d)
Writes a singledouble
to the underlyingDataOutputStream
.abstract void
writeInt(int i)
Writes a singleint
to the underlyingDataOutputStream
.abstract void
writeUTF(String s)
Writes aString
to the underlyingDataOutputStream
.
-
-
-
Method Detail
-
writeUTF
public abstract void writeUTF(String s) throws IOException
Writes aString
to the underlyingDataOutputStream
.- Parameters:
s
- TheUTF encoded
characters.- Throws:
IOException
- Thrown if IO errors occurred.
-
writeInt
public abstract void writeInt(int i) throws IOException
Writes a singleint
to the underlyingDataOutputStream
.- Parameters:
i
- Theint
value.- Throws:
IOException
- Thrown if IO errors occurred.
-
writeDouble
public abstract void writeDouble(double d) throws IOException
Writes a singledouble
to the underlyingDataOutputStream
.- Parameters:
d
- Thedouble
value.- Throws:
IOException
- Thrown if IO errors occurred.
-
close
public abstract void close() throws IOException
Closes the underlyingDataOutputStream
.- Throws:
IOException
- Thrown if IO errors occurred.
-
persist
public abstract void persist() throws IOException
Serializes themodel
using thewriteUTF(String)
,writeDouble(double)
, orwriteInt(int)
} methods implemented by extending classes.- Throws:
IOException
- Thrown if IO errors occurred.
-
-