edu.northwestern.at.morphadorner.corpuslinguistics.outputter

## Class PrintStreamAdornedWordOutputter

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.outputter.PrintStreamAdornedWordOutputter

- All Implemented Interfaces:
    AdornedWordOutputter
  Direct Known Subclasses:
    ByteStreamAdornedWordOutputter, ConsoleAdornedWordOutputter, DefaultAdornedWordOutputter, SimpleXMLAdornedWordOutputter

      public class PrintStreamAdornedWordOutputter
      extends java.lang.Object
      implements AdornedWordOutputter

  Outputs adorned words to a print stream.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `fileEncoding` Output file encoding.
    `protected java.lang.String` | `fileName` Output file name.
    `protected java.io.PrintStream` | `printStream` PrintStream for console output.
    `protected char` | `separatorCharacter` Separator character for output.
    `protected java.lang.String[]` | `wordAttributeNames` Word attribute names.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PrintStreamAdornedWordOutputter()` Create outputter.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close outputter.
    `void` | `createOutputFile(java.lang.String fileName, java.lang.String encoding, char separatorCharacter)` Create output file.
    `java.lang.String` | `getOutputFileEncoding()` Get output file encoding.
    `java.lang.String` | `getOutputFileName()` Get output file name.
    `void` | `outputWordAndAdornments(java.util.List<java.lang.String> wordAndAdornments)` Outputs a word and its adornments (part of speech, lemmata, etc).
    `void` | `outputWordAndAdornments(java.lang.String[] wordAndAdornments)` Outputs a word and its adornments (part of speech, lemmata, etc).
    `void` | `setWordAttributeNames(java.util.List<java.lang.String> wordAttributeNames)` Set word attribute names.

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

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

- - ### Field Detail

    - #### printStream

          protected java.io.PrintStream printStream

      PrintStream for console output.

    - #### separatorCharacter

          protected char separatorCharacter

      Separator character for output.

    - #### fileName

          protected java.lang.String fileName

      Output file name.

    - #### fileEncoding

          protected java.lang.String fileEncoding

      Output file encoding.

    - #### wordAttributeNames

          protected java.lang.String[] wordAttributeNames

      Word attribute names.

  - ### Constructor Detail

    - #### PrintStreamAdornedWordOutputter

          public PrintStreamAdornedWordOutputter()

      Create outputter.

  - ### Method Detail

    - #### createOutputFile

          public void createOutputFile(java.lang.String fileName,
                              java.lang.String encoding,
                              char separatorCharacter)
                                throws java.io.IOException

      Create output file.
      Specified by:
        `createOutputFile` in interface `AdornedWordOutputter`
      Parameters:
        `fileName` - Output file name.
        `encoding` - Encoding for the output file.
        `separatorCharacter` - Output separator character.
      Throws:
        `java.io.IOException`

    - #### setWordAttributeNames

          public void setWordAttributeNames(java.util.List<java.lang.String> wordAttributeNames)

      Set word attribute names.
      Specified by:
        `setWordAttributeNames` in interface `AdornedWordOutputter`
      Parameters:
        `wordAttributeNames` - Word attribute names.

    - #### outputWordAndAdornments

          public void outputWordAndAdornments(java.lang.String[] wordAndAdornments)
                                       throws java.io.IOException

      Outputs a word and its adornments (part of speech, lemmata, etc).
      Specified by:
        `outputWordAndAdornments` in interface `AdornedWordOutputter`
      Parameters:
        `wordAndAdornments` - Word and its adornments as an array of string.
      Throws:
        `java.io.IOException` - If an output error occurs.

        Outputs word and adornments as a tab-separated text line to a print stream.

    - #### outputWordAndAdornments

          public void outputWordAndAdornments(java.util.List<java.lang.String> wordAndAdornments)
                                       throws java.io.IOException

      Outputs a word and its adornments (part of speech, lemmata, etc).
      Specified by:
        `outputWordAndAdornments` in interface `AdornedWordOutputter`
      Parameters:
        `wordAndAdornments` - Word and its adornments as a list of strings.
      Throws:
        `java.io.IOException` - If an output error occurs.

        Outputs word and adornments as a tab-separated text line to a print stream.

    - #### getOutputFileName

          public java.lang.String getOutputFileName()

      Get output file name.
      Specified by:
        `getOutputFileName` in interface `AdornedWordOutputter`
      Returns:
        Output file name.

    - #### getOutputFileEncoding

          public java.lang.String getOutputFileEncoding()

      Get output file encoding.
      Specified by:
        `getOutputFileEncoding` in interface `AdornedWordOutputter`
      Returns:
        Output file encoding.

    - #### close

          public void close()

      Close outputter.
      Specified by:
        `close` in interface `AdornedWordOutputter`