info.bioinfweb.jphyloio.formats.nexus.blockhandlers

## Interface NexusBlockHandler

- All Known Implementing Classes:
    AbstractNexusBlockHandler, CharactersDataUnalignedBlockHandler, ENewickNetworksBlockHandler, TaxaBlockHandler, TreesBlockHandler

      public interface NexusBlockHandler

  A Nexus block handler implements methods that shall be executed by `NexusEventReader` each time an according block `BEGIN` or `END` command is read.

  Application developers implementing support for custom Nexus blocks can implement this interface for their block is necessary. In most cases it will be useful to inherit such implementations from `AbstractNexusBlockHandler`.

  Author:
    Ben Stöver
  See Also:
    `AbstractNexusBlockHandler`, `NexusEventReader`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `beforeCommand(NexusReaderStreamDataProvider streamDataProvider, java.lang.String commandName, NexusCommandEventReader commandReader)` This method is called before a command found in a block handled by this handler is processed, by calling the according command reader.
    `java.util.Collection<java.lang.String>` | `getBlockNames()` Returns a collection of the block names this handler supports.
    `void` | `handleBegin(NexusReaderStreamDataProvider streamDataProvider)` This method will be called by `NexusEventReader` each time a `BEGIN` command for a block listed in `getBlockNames()` is read.
    `void` | `handleEnd(NexusReaderStreamDataProvider streamDataProvider)` This method will be called by `NexusEventReader` each time an `END` command for a block listed in `getBlockNames()` is read.

- - ### Method Detail

    - #### getBlockNames

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

      Returns a collection of the block names this handler supports.
      Returns:
        an umodifyable collection of block names

    - #### handleBegin

          void handleBegin(NexusReaderStreamDataProvider streamDataProvider)

      This method will be called by `NexusEventReader` each time a `BEGIN` command for a block listed in `getBlockNames()` is read.
      Parameters:
        `streamDataProvider` - the stream data provider of the calling `NexusEventReader`
      See Also:
        `AbstractEventReader.getStreamDataProvider()`

    - #### handleEnd

          void handleEnd(NexusReaderStreamDataProvider streamDataProvider)

      This method will be called by `NexusEventReader` each time an `END` command for a block listed in `getBlockNames()` is read.
      Parameters:
        `streamDataProvider` - the stream data provider of the calling `NexusEventReader`
      See Also:
        `AbstractEventReader.getStreamDataProvider()`

    - #### beforeCommand

          void beforeCommand(NexusReaderStreamDataProvider streamDataProvider,
                             java.lang.String commandName,
                             NexusCommandEventReader commandReader)

      This method is called before a command found in a block handled by this handler is processed, by calling the according command reader.
      Parameters:
        `streamDataProvider` - the stream data provider of the calling `NexusEventReader`
        `commandName` - the name of the Nexus command, that will be processed next
        `commandReader` - the reader that will be used to process this command or `null` if no according reader was found
      See Also:
        `AbstractEventReader.getStreamDataProvider()`