info.bioinfweb.jphyloio.formats.nexus.blockhandlers

## Class NexusBlockHandlerMap

- java.lang.Object
- - info.bioinfweb.jphyloio.formats.nexus.blockhandlers.NexusBlockHandlerMap

-     public class NexusBlockHandlerMap
      extends java.lang.Object

  Manages Nexus block handlers for an instance of `NexusEventReader`.
  Author:
    Ben Stöver

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NexusBlockHandlerMap()` Creates a new empty instance of this class.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addHandler(NexusBlockHandler handler)` Adds a new handler to this map.
    `void` | `addJPhyloIOHandlers()` Adds all handlers that are available in JPhyloIO to this instance.
    `NexusBlockHandler` | `getHandler(java.lang.String blockName)` Returns the handler that is registered for the specified block name.
    `boolean` | `hasHandler(java.lang.String blockName)` Checks whether a handler for the specified block name is contained in this map.
    `static NexusBlockHandlerMap` | `newJPhyloIOInstance()` Returns a new instance of this class, already containing all block handlers available in the core module of JPhyloIO.

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

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

- - ### Constructor Detail

    - #### NexusBlockHandlerMap

          public NexusBlockHandlerMap()

      Creates a new empty instance of this class.
      See Also:
        `addJPhyloIOHandlers()`, `newJPhyloIOInstance()`

  - ### Method Detail

    - #### newJPhyloIOInstance

          public static NexusBlockHandlerMap newJPhyloIOInstance()

      Returns a new instance of this class, already containing all block handlers available in the core module of JPhyloIO. (`addJPhyloIOHandlers()` is called internally.)
      Returns:
        the new instance

    - #### addHandler

          public void addHandler(NexusBlockHandler handler)

      Adds a new handler to this map.

      Note that this method can overwrite previous entries, if a previously add handler had a block name in common with the handler add here.

      Parameters:
        `handler` - the new handler to add

    - #### addJPhyloIOHandlers

          public void addJPhyloIOHandlers()

      Adds all handlers that are available in JPhyloIO to this instance.

    - #### getHandler

          public NexusBlockHandler getHandler(java.lang.String blockName)

      Returns the handler that is registered for the specified block name.
      Parameters:
        `blockName` - the name of the block (this method is not case sensitive)
      Returns:
        the according handler or `null` if no handler could be found

    - #### hasHandler

          public boolean hasHandler(java.lang.String blockName)

      Checks whether a handler for the specified block name is contained in this map.
      Parameters:
        `blockName` - the name of the Nexus block
      Returns:
        `true` if a handler is available or `false` otherwise