PlainTextFileDataReader (Apache OpenNLP Tools 2.5.9 API)
Description: declaration: package: opennlp.tools.ml.model, class: PlainTextFileDataReader

# Class PlainTextFileDataReader

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

All Implemented Interfaces:
  `DataReader`

public class PlainTextFileDataReader extends Object implements DataReader
A generic `DataReader` implementation for plain text files.

See Also:
  - `DataReader`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PlainTextFileDataReader(BufferedReader in)`
  Initializes a `PlainTextFileDataReader` via a `BufferedReader`.
  `PlainTextFileDataReader(File f)`
  Initializes a `PlainTextFileDataReader` via a `File`.
  `PlainTextFileDataReader(InputStream in)`
  Initializes a `PlainTextFileDataReader` via a `InputStream`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `readDouble()`
  `int`
  `readInt()`
  `String`
  `readUTF()`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### PlainTextFileDataReader

    public PlainTextFileDataReader(File f) throws IOException
    Initializes a `PlainTextFileDataReader` via a `File`.
    Parameters:
      `f` - The `File` that references the model to be read.
    Throws:
      `IOException` - Thrown if IO errors occurred.

  - ### PlainTextFileDataReader

    public PlainTextFileDataReader(InputStream in)
    Initializes a `PlainTextFileDataReader` via a `InputStream`.
    Parameters:
      `in` - The `InputStream` that references the file to be read.

  - ### PlainTextFileDataReader

    public PlainTextFileDataReader(BufferedReader in)
    Initializes a `PlainTextFileDataReader` via a `BufferedReader`.
    Parameters:
      `in` - The `BufferedReader` that references the file to be read.

- ## Method Details

  - ### readDouble

    public double readDouble() throws IOException
    Specified by:
      `readDouble` in interface `DataReader`
    Returns:
      Reads and returns a `double` value.
    Throws:
      `IOException` - Thrown if IO errors occurred during read operation.

  - ### readInt

    public int readInt() throws IOException
    Specified by:
      `readInt` in interface `DataReader`
    Returns:
      Reads and returns an `int` value.
    Throws:
      `IOException` - Thrown if IO errors occurred during read operation.

  - ### readUTF

    public String readUTF() throws IOException
    Specified by:
      `readUTF` in interface `DataReader`
    Returns:
      Reads and returns `UTF-encoded characters`.
    Throws:
      `IOException` - Thrown if IO errors occurred during read operation.