info.bioinfweb.jphyloio.formats.nexus

## Class NexusFactory

- java.lang.Object
- - info.bioinfweb.jphyloio.factory.AbstractSingleReaderWriterFactory
  - - info.bioinfweb.jphyloio.factory.AbstractStartStringSingleFactory
    - - info.bioinfweb.jphyloio.formats.nexus.NexusFactory

- All Implemented Interfaces:
    SingleReaderWriterFactory, JPhyloIOFormatIDs, NexusConstants

      public class NexusFactory
      extends AbstractStartStringSingleFactory
      implements NexusConstants, JPhyloIOFormatIDs

  Reader and writer factory for the Nexus format.
  Since:
    0.0.0
  Author:
    Ben Stöver

- - ### Field Summary

    - ### Fields inherited from interface info.bioinfweb.jphyloio.formats.nexus.NexusConstants

      `ALTERNATIVE_END_COMMAND, BEGIN_COMMAND, BLOCK_NAME_CHARACTERS, BLOCK_NAME_DATA, BLOCK_NAME_NETWORKS, BLOCK_NAME_SETS, BLOCK_NAME_TAXA, BLOCK_NAME_TREES, BLOCK_NAME_UNALIGNED, CHARACTER_NAME_STATES_SEPARATOR, COMMAND_END, COMMAND_NAME_CHAR_LABELS, COMMAND_NAME_CHAR_SET, COMMAND_NAME_CHAR_STATE_LABELS, COMMAND_NAME_DIMENSIONS, COMMAND_NAME_FORMAT, COMMAND_NAME_LINK, COMMAND_NAME_MATRIX, COMMAND_NAME_NETWORK, COMMAND_NAME_TAX_LABELS, COMMAND_NAME_TAXON_SET, COMMAND_NAME_TITLE, COMMAND_NAME_TRANSLATE, COMMAND_NAME_TREE, COMMAND_NAME_TREE_SET, COMMENT_END, COMMENT_START, DIMENSIONS_SUBCOMMAND_NCHAR, DIMENSIONS_SUBCOMMAND_NEW_TAXA, DIMENSIONS_SUBCOMMAND_NTAX, ELEMENT_SEPARATOR, END_COMMAND, FIRST_LINE, FORMAT_NAME_STANDARD, FORMAT_NAME_VECTOR, FORMAT_SUBCOMMAND_DATA_TYPE, FORMAT_SUBCOMMAND_GAP_CHAR, FORMAT_SUBCOMMAND_INTERLEAVE, FORMAT_SUBCOMMAND_MATCH_CHAR, FORMAT_SUBCOMMAND_MISSING_CHAR, FORMAT_SUBCOMMAND_NO_LABELS, FORMAT_SUBCOMMAND_NO_TOKENS, FORMAT_SUBCOMMAND_SYMBOLS, FORMAT_SUBCOMMAND_TOKENS, FORMAT_SUBCOMMAND_TRANSPOSE, FORMAT_VALUE_CONTINUOUS_DATA_TYPE, FORMAT_VALUE_DNA_DATA_TYPE, FORMAT_VALUE_MIXED_DATA_TYPE, FORMAT_VALUE_NUCLEOTIDE_DATA_TYPE, FORMAT_VALUE_PROTEIN_DATA_TYPE, FORMAT_VALUE_RNA_DATA_TYPE, FORMAT_VALUE_STANDARD_DATA_TYPE, KEY_VALUE_SEPARATOR, MATRIX_POLYMORPHIC_TOKEN_END, MATRIX_POLYMORPHIC_TOKEN_START, MATRIX_UNCERTAINS_TOKEN_END, MATRIX_UNCERTAINS_TOKEN_START, NEXUS_FORMAT_NAME, NEXUS_NAMESPACE_PREFIX, NEXUS_PREDICATE_NAMESPACE, SET_END_INDEX_SYMBOL, SET_KEY_WORD_ALL, SET_KEY_WORD_REMAINING, SET_REGULAR_INTERVAL_SYMBOL, SET_TO_SYMBOL, SET_VECTOR_CONTAINED, SET_VECTOR_NOT_CONTAINED, UNTIL_WHITESPACE_COMMENT_COMMAND_EQUAL_PATTERN, UNTIL_WHITESPACE_COMMENT_COMMAND_PATTERN, VALUE_DELIMITER, WORD_DELIMITER`

    - ### Fields inherited from interface info.bioinfweb.jphyloio.formats.JPhyloIOFormatIDs

      `FASTA_FORMAT_ID, FORMAT_ID_PREFIX, MEGA_FORMAT_ID, NEWICK_FORMAT_ID, NEXML_FORMAT_ID, NEXUS_FORMAT_ID, PDE_FORMAT_ID, PHYLIP_FORMAT_ID, PHYLOXML_FORMAT_ID, SEQUENTIAL_PHYLIP_FORMAT_ID, XTG_FORMAT_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NexusFactory()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected JPhyloIOFormatInfo` | `createFormatInfo()`
    `JPhyloIOEventReader` | `getReader(java.io.InputStream stream, ReadWriteParameterMap parameters)` Creates a new reader instance for the target format of this factory.
    `JPhyloIOEventReader` | `getReader(java.io.Reader reader, ReadWriteParameterMap parameters)` Creates a new reader instance for the target format of this factory.
    `JPhyloIOEventWriter` | `getWriter()` Creates a new writer instance for the target format of this factory.
    `boolean` | `hasReader()` Determines whether this factory is able to create reader instances for its target format.
    `boolean` | `hasWriter()` Determines whether this factory is able to create writer instances for its target format.

    - ### Methods inherited from class info.bioinfweb.jphyloio.factory.AbstractStartStringSingleFactory

      `checkFormat, getExpectedStart`

    - ### Methods inherited from class info.bioinfweb.jphyloio.factory.AbstractSingleReaderWriterFactory

      `checkFormat, getFormatInfo`

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

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

    - ### Methods inherited from interface info.bioinfweb.jphyloio.factory.SingleReaderWriterFactory

      `checkFormat, getFormatInfo`

- - ### Constructor Detail

    - #### NexusFactory

          public NexusFactory()

  - ### Method Detail

    - #### getReader

          public JPhyloIOEventReader getReader(java.io.InputStream stream,
                                               ReadWriteParameterMap parameters)
                                        throws java.io.IOException

      Description copied from interface: `SingleReaderWriterFactory`
      Creates a new reader instance for the target format of this factory.
      Specified by:
        `getReader` in interface `SingleReaderWriterFactory`
      Parameters:
        `stream` - the stream to provide the content for the reader
        `parameters` - the parameter map for the new reader instance
      Returns:
        the new reader instance
      Throws:
        `java.io.IOException`

    - #### getReader

          public JPhyloIOEventReader getReader(java.io.Reader reader,
                                               ReadWriteParameterMap parameters)
                                        throws java.io.IOException

      Description copied from interface: `SingleReaderWriterFactory`
      Creates a new reader instance for the target format of this factory.
      Specified by:
        `getReader` in interface `SingleReaderWriterFactory`
        `parameters` - the parameter map for the new reader instance
      Returns:
        the new reader instance or `null` if this factory is not able to create readers
      Throws:
        `java.io.IOException`
      See Also:
        `SingleReaderWriterFactory.hasReader()`

    - #### getWriter

          public JPhyloIOEventWriter getWriter()

      Description copied from interface: `SingleReaderWriterFactory`
      Creates a new writer instance for the target format of this factory.
      Specified by:
        `getWriter` in interface `SingleReaderWriterFactory`
      Returns:
        the new writer instance or `null` if this factory is not able to create writers
      See Also:
        `SingleReaderWriterFactory.hasWriter()`

    - #### hasReader

          public boolean hasReader()

      Description copied from interface: `SingleReaderWriterFactory`
      Determines whether this factory is able to create reader instances for its target format.
      Specified by:
        `hasReader` in interface `SingleReaderWriterFactory`
      Returns:
        `true` if creating readers is supported or `false` otherwise

    - #### hasWriter

          public boolean hasWriter()

      Description copied from interface: `SingleReaderWriterFactory`
      Determines whether this factory is able to create writer instances for its target format.
      Specified by:
        `hasWriter` in interface `SingleReaderWriterFactory`
      Returns:
        `true` if creating writers is supported or `false` otherwise

    - #### createFormatInfo

          protected JPhyloIOFormatInfo createFormatInfo()

      Specified by:
        `createFormatInfo` in class `AbstractSingleReaderWriterFactory`