Package opennlp.tools.ml.model
Class GenericModelWriter
java.lang.Object
opennlp.tools.ml.model.AbstractModelWriter
opennlp.tools.ml.model.GenericModelWriter
An generic 
AbstractModelWriter implementation.- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionGenericModelWriter(AbstractModel model, DataOutputStream dos) Initializes aGenericModelWriterfor anAbstractModelwith an associatedDataOutputStreamthe model shall be written to.GenericModelWriter(AbstractModel model, File file) Initializes aGenericModelWriterfor anAbstractModelwith an associatedFilethe model shall be written to.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Closes the underlyingDataOutputStream.voidpersist()Serializes themodelusing theAbstractModelWriter.writeUTF(String),AbstractModelWriter.writeDouble(double), orAbstractModelWriter.writeInt(int)} methods implemented by extending classes.voidwriteDouble(double d) Writes a singledoubleto the underlyingDataOutputStream.voidwriteInt(int i) Writes a singleintto the underlyingDataOutputStream.voidWrites aStringto the underlyingDataOutputStream.
- 
Constructor Details- 
GenericModelWriterInitializes aGenericModelWriterfor anAbstractModelwith an associatedFilethe model shall be written to.- Parameters:
- model- The- modelto write out.
- file- The- Filethat used to be written to.
- Throws:
- IOException- Thrown if IO errors occurred.
 
- 
GenericModelWriterInitializes aGenericModelWriterfor anAbstractModelwith an associatedDataOutputStreamthe model shall be written to.- Parameters:
- model- The- modelto write out.
- dos- The- DataOutputStreamthat used to be written to.
 
 
- 
- 
Method Details- 
closeDescription copied from class:AbstractModelWriterCloses the underlyingDataOutputStream.- Specified by:
- closein class- AbstractModelWriter
- Throws:
- IOException- Thrown if IO errors occurred.
 
- 
persistDescription copied from class:AbstractModelWriterSerializes themodelusing theAbstractModelWriter.writeUTF(String),AbstractModelWriter.writeDouble(double), orAbstractModelWriter.writeInt(int)} methods implemented by extending classes.- Specified by:
- persistin class- AbstractModelWriter
- Throws:
- IOException- Thrown if IO errors occurred.
 
- 
writeDoubleDescription copied from class:AbstractModelWriterWrites a singledoubleto the underlyingDataOutputStream.- Specified by:
- writeDoublein class- AbstractModelWriter
- Parameters:
- d- The- doublevalue.
- Throws:
- IOException- Thrown if IO errors occurred.
 
- 
writeIntDescription copied from class:AbstractModelWriterWrites a singleintto the underlyingDataOutputStream.- Specified by:
- writeIntin class- AbstractModelWriter
- Parameters:
- i- The- intvalue.
- Throws:
- IOException- Thrown if IO errors occurred.
 
- 
writeUTFDescription copied from class:AbstractModelWriterWrites aStringto the underlyingDataOutputStream.- Specified by:
- writeUTFin class- AbstractModelWriter
- Parameters:
- s- The- UTF encodedcharacters.
- Throws:
- IOException- Thrown if IO errors occurred.
 
 
-