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 voidclose()Closes the underlyingDataOutputStream.abstract voidpersist()Serializes themodelusing thewriteUTF(String),writeDouble(double), orwriteInt(int)} methods implemented by extending classes.abstract voidwriteDouble(double d)Writes a singledoubleto the underlyingDataOutputStream.abstract voidwriteInt(int i)Writes a singleintto the underlyingDataOutputStream.abstract voidwriteUTF(String s)Writes aStringto the underlyingDataOutputStream.
-
-
-
Method Detail
-
writeUTF
public abstract void writeUTF(String s) throws IOException
Writes aStringto the underlyingDataOutputStream.- Parameters:
s- TheUTF encodedcharacters.- Throws:
IOException- Thrown if IO errors occurred.
-
writeInt
public abstract void writeInt(int i) throws IOExceptionWrites a singleintto the underlyingDataOutputStream.- Parameters:
i- Theintvalue.- Throws:
IOException- Thrown if IO errors occurred.
-
writeDouble
public abstract void writeDouble(double d) throws IOExceptionWrites a singledoubleto the underlyingDataOutputStream.- Parameters:
d- Thedoublevalue.- Throws:
IOException- Thrown if IO errors occurred.
-
close
public abstract void close() throws IOExceptionCloses the underlyingDataOutputStream.- Throws:
IOException- Thrown if IO errors occurred.
-
persist
public abstract void persist() throws IOExceptionSerializes themodelusing thewriteUTF(String),writeDouble(double), orwriteInt(int)} methods implemented by extending classes.- Throws:
IOException- Thrown if IO errors occurred.
-
-