info.bioinfweb.jphyloio.formats.nexus.commandreaders

## Interface NexusCommandEventReader

- All Known Implementing Classes:
    AbstractCharLabelsReader, AbstractKeyValueCommandReader, AbstractNexusCommandEventReader, AbstractNexusSetReader, CharLabelsReader, CharSetReader, CharStateLabelsReader, DefaultCommandReader, DimensionsReader, ENewickNetworkReader, FormatReader, IDBasedSetsReader, LinkReader, MatrixReader, TaxLabelsReader, TaxSetReader, TitleReader, TranslateReader, TreeReader, TreeSetReader

      public interface NexusCommandEventReader

  Interface to be implement by all classes and parse a single Nexus command and convert its contents into JPhyloIO events.

  Implementing classes must offer a constructor with a single argument of the type `NexusReaderStreamDataProvider` to take information about the reader and the Nexus document.

  A new instance should be created for parsing each command. The reader should be positioned at the first character behind the terminal semicolon after the implementing instance parsed all data and `#isAllDataProcessed()` should return `true` then.

  Author:
    Ben Stöver

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getCommandName()` Returns the name of the Nexus command that can be parsed by this instance.
    `java.util.Collection<java.lang.String>` | `getValidBlocks()` Returns a collection with the names of the Nexus blocks the command parsed by the implementing class may be contained in.
    `boolean` | `readNextEvent()` Adds at least one additional event (generated from the current Nexus command) to the event queue.

- - ### Method Detail

    - #### getCommandName

          java.lang.String getCommandName()

      Returns the name of the Nexus command that can be parsed by this instance.
      Returns:
        a non-empty string

    - #### getValidBlocks

          java.util.Collection<java.lang.String> getValidBlocks()

      Returns a collection with the names of the Nexus blocks the command parsed by the implementing class may be contained in.

      An empty collection returned here indicates that this reader is valid in all Nexus blocks.

      Returns:
        a collection with the block names

    - #### readNextEvent

          boolean readNextEvent()
                         throws java.io.IOException

      Adds at least one additional event (generated from the current Nexus command) to the event queue.
      Returns:
        `true` if at least one additional event was added or `false` if the underlying Nexus command was already completely processed an no more events can generated from it
      Throws:
        `java.io.IOException`