info.bioinfweb.jphyloio.formats.newick

## Class NewickEventWriter

- java.lang.Object
- - info.bioinfweb.jphyloio.AbstractEventWriter<P>
  - - info.bioinfweb.jphyloio.formats.text.AbstractTextEventWriter<TextWriterStreamDataProvider<NewickEventWriter>>
    - - info.bioinfweb.jphyloio.formats.newick.NewickEventWriter

- All Implemented Interfaces:
    NewickConstants, JPhyloIOEventWriter, JPhyloIOFormatSpecificObject

      public class NewickEventWriter
      extends AbstractTextEventWriter<TextWriterStreamDataProvider<NewickEventWriter>>
      implements NewickConstants

  Event writer for the Newick format.

  ### Recognized parameters

  - `ReadWriteParameterNames.KEY_WRITER_INSTANCE`
  - `ReadWriteParameterNames.KEY_LOGGER`
  - `ReadWriteParameterNames.KEY_LINE_SEPARATOR`
  - `ReadWriteParameterNames.KEY_MAXIMUM_NAME_LENGTH` (If this parameter is omitted, any name length is possible.)
  - `ReadWriteParameterNames.KEY_LABEL_EDITING_REPORTER`
  - `ReadWriteParameterNames.KEY_OBJECT_TRANSLATOR_FACTORY`
  Author:
    Ben Stöver
  See Also:
    `0.0.0`, Metadata demo application

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class info.bioinfweb.jphyloio.AbstractEventWriter

      `AbstractEventWriter.NoEditUniqueLabelHandler, AbstractEventWriter.UniqueLabelHandler`

  - ### Field Summary

    - ### Fields inherited from class info.bioinfweb.jphyloio.AbstractEventWriter

      `EDITED_LABEL_SEPARATOR`

    - ### Fields inherited from interface info.bioinfweb.jphyloio.formats.newick.NewickConstants

      `ALLOCATION_SEPARATOR_SYMBOL, ALLOCATION_SYMBOL, ALTERNATIVE_NAME_DELIMITER, COMMENT_END, COMMENT_START, DATA_TYPE_NEWICK_ARRAY, E_NEWICK_EDGE_TYPE_HYBRIDIZATION, E_NEWICK_EDGE_TYPE_LATERAL_GENE_TRANSFER, E_NEWICK_EDGE_TYPE_RECOMBINATION, E_NEWICK_NAMESPACE_PREFIX, E_NEWICK_NETWORK_DATA_SEPARATOR, ELEMENT_SEPERATOR, FIELD_END_SYMBOL, FIELD_START_SYMBOL, FIELD_VALUE_SEPARATOR_SYMBOL, FREE_NAME_BLANK, HOT_COMMENT_START_SYMBOL, INDEX_END_SYMBOL, INDEX_START_SYMBOL, LENGTH_SEPERATOR, NAME_DELIMITER, NEWICK_DATA_TYPE_NAMESPACE, NEWICK_FORMAT_NAME, NEWICK_NAMESPACE_PREFIX, NHX_KEY_CONFIDENCE, NHX_KEY_EVENT, NHX_KEY_GENE_NAME, NHX_KEY_PREFIX, NHX_KEY_SCIENTIFIC_NAME, NHX_KEY_SEQUENCE_ACCESSION, NHX_KEY_TAXONOMY_ID, NHX_START, NHX_VALUE_SEPARATOR_SYMBOL, PREDICATE_E_NEWICK_EDGE_TYPE, ROOTED_HOT_COMMENT, SUBTREE_END, SUBTREE_START, TERMINAL_SYMBOL, UNROOTED_HOT_COMMENT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NewickEventWriter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected TextWriterStreamDataProvider<NewickEventWriter>` | `createStreamDataProvider()` This method is called in the constructor of `AbstractEventWriter` to initialize the stream data provider that will be returned by `AbstractEventWriter.getStreamDataProvider()`.
    `protected void` | `doWriteDocument(DocumentDataAdapter document, java.io.Writer writer, ReadWriteParameterMap parameters)`
    `java.lang.String` | `getFormatID()` Returns a string ID uniquely identifying the target format of this instance.

    - ### Methods inherited from class info.bioinfweb.jphyloio.formats.text.AbstractTextEventWriter

      `getWriter`

    - ### Methods inherited from class info.bioinfweb.jphyloio.AbstractEventWriter

      `createUniqueLabel, createUniqueLabel, createUniqueLabel, createUniqueLinkedOTULabel, decreaseIndention, determineMaxSequenceLength, extendSequence, getFileStartInfo, getIndention, getLabeledIDName, getLinkedOTUNameOTUFirst, getLinkedOTUNameOwnFirst, getReferencedOTUList, getStreamDataProvider, increaseIndention, logIngnoredOTULists, writeDocument, writeDocument, writeDocument, writeLineBreak, writeLineStart`

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

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

- - ### Constructor Detail

    - #### NewickEventWriter

          public NewickEventWriter()

  - ### Method Detail

    - #### getFormatID

          public java.lang.String getFormatID()

      Description copied from interface: `JPhyloIOFormatSpecificObject`
      Returns a string ID uniquely identifying the target format of this instance. Additional information on the format can be retrieved by passing the returned ID to `JPhyloIOReaderWriterFactory.getFormatInfo(String)`.

      Third party developers that create readers or writers for additional formats must make sure to use a globally unique format ID. It is strongly recommended to use owned reverse domain names for this (e.g. `org.example.additionalformat`).

      Specified by:
        `getFormatID` in interface `JPhyloIOFormatSpecificObject`
      Returns:
        the ID of the target format of this instance
      See Also:
        `JPhyloIOReaderWriterFactory.getFormatInfo(String)`

    - #### createStreamDataProvider

          protected TextWriterStreamDataProvider<NewickEventWriter> createStreamDataProvider()

      Description copied from class: `AbstractEventWriter`
      This method is called in the constructor of `AbstractEventWriter` to initialize the stream data provider that will be returned by `AbstractEventWriter.getStreamDataProvider()`. Inheriting classes that use their own stream data provider implementation should overwrite this method.

      This default implementation creates a new instance of `WriterStreamDataProvider`.

      Overrides:
        `createStreamDataProvider` in class `AbstractEventWriter<TextWriterStreamDataProvider<NewickEventWriter>>`
      Returns:
        the stream data provider to be used with this instance

    - #### doWriteDocument

          protected void doWriteDocument(DocumentDataAdapter document,
                                         java.io.Writer writer,
                                         ReadWriteParameterMap parameters)
                                  throws java.io.IOException

      Overrides:
        `doWriteDocument` in class `AbstractTextEventWriter<TextWriterStreamDataProvider<NewickEventWriter>>`
      Throws:
        `java.io.IOException`