public class NexusBlockHandlerMap extends java.lang.Object
NexusEventReader
.Constructor and Description |
---|
NexusBlockHandlerMap()
Creates a new empty instance of this class.
|
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.
|
public NexusBlockHandlerMap()
addJPhyloIOHandlers()
,
newJPhyloIOInstance()
public static NexusBlockHandlerMap newJPhyloIOInstance()
addJPhyloIOHandlers()
is called internally.)public void addHandler(NexusBlockHandler handler)
Note that this method can overwrite previous entries, if a previously add handler had a block name in common with the handler add here.
handler
- the new handler to addpublic void addJPhyloIOHandlers()
public NexusBlockHandler getHandler(java.lang.String blockName)
blockName
- the name of the block (this method is not case sensitive)null
if no handler could be foundpublic boolean hasHandler(java.lang.String blockName)
blockName
- the name of the Nexus blocktrue
if a handler is available or false
otherwise