Package opennlp.tools.ml.model

# Class AbstractModelWriter

java.lang.Object
opennlp.tools.ml.model.AbstractModelWriter

Direct Known Subclasses:
  `AbstractMLModelWriter`, `GenericModelWriter`

public abstract class AbstractModelWriter extends Object
An abstract, basic implementation of a model writer.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractModelWriter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract void`
  `close()`
  Closes the underlying `DataOutputStream`.
  `abstract void`
  `persist()`
  Serializes the `model` using the `writeUTF(String)`, `writeDouble(double)`, or `writeInt(int)`} methods implemented by extending classes.
  `abstract void`
  `writeDouble(double d)`
  Writes a single `double` to the underlying `DataOutputStream`.
  `abstract void`
  `writeInt(int i)`
  Writes a single `int` to the underlying `DataOutputStream`.
  `abstract void`
  `writeUTF(String s)`
  Writes a `String` to the underlying `DataOutputStream`.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AbstractModelWriter

    public AbstractModelWriter()

- ## Method Details

  - ### writeUTF

    public abstract void writeUTF(String s) throws IOException
    Writes a `String` to the underlying `DataOutputStream`.
    Parameters:
      `s` - The `UTF encoded` characters.
    Throws:
      `IOException` - Thrown if IO errors occurred.

  - ### writeInt

    public abstract void writeInt(int i) throws IOException
    Writes a single `int` to the underlying `DataOutputStream`.
    Parameters:
      `i` - The `int` value.
    Throws:
      `IOException` - Thrown if IO errors occurred.

  - ### writeDouble

    public abstract void writeDouble(double d) throws IOException
    Writes a single `double` to the underlying `DataOutputStream`.
    Parameters:
      `d` - The `double` value.
    Throws:
      `IOException` - Thrown if IO errors occurred.

  - ### close

    public abstract void close() throws IOException
    Closes the underlying `DataOutputStream`.
    Throws:
      `IOException` - Thrown if IO errors occurred.

  - ### persist

    public abstract void persist() throws IOException
    Serializes the `model` using the `writeUTF(String)`, `writeDouble(double)`, or `writeInt(int)`} methods implemented by extending classes.
    Throws:
      `IOException` - Thrown if IO errors occurred.