public abstract class AbstractNexusCommandEventReader extends java.lang.Object implements NexusCommandEventReader
NexusCommandEventReader
.Constructor and Description |
---|
AbstractNexusCommandEventReader(java.lang.String commandName,
java.lang.String[] validBlocks,
NexusReaderStreamDataProvider streamDataProvider)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
protected void |
consumeWhiteSpaceAndCommentsToBuffer(java.util.Collection<JPhyloIOEvent> buffer) |
protected abstract boolean |
doReadNextEvent() |
java.lang.String |
getCommandName()
Returns the name of the Nexus command that can be parsed by this instance.
|
protected NexusReaderStreamDataProvider |
getStreamDataProvider() |
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.
|
protected boolean |
isAllDataProcessed()
Returns
true if the whole command this instance was created on has been parsed or false
if another events can be generated by the next call of readNextEvent() . |
boolean |
readNextEvent()
Adds at least one additional event (generated from the current Nexus command) to the event queue.
|
protected void |
setAllDataProcessed(boolean allDataProcessed) |
public AbstractNexusCommandEventReader(java.lang.String commandName, java.lang.String[] validBlocks, NexusReaderStreamDataProvider streamDataProvider)
Note that non-abstract inherited classes need to specify a constructor matching the requirements defined by
NexusCommandEventReader
.
validBlocks
- an array with the names of the Nexus blocks the command parsed by the implementing
class may be contained inpublic java.lang.String getCommandName()
NexusCommandEventReader
getCommandName
in interface NexusCommandEventReader
public java.util.Collection<java.lang.String> getValidBlocks()
NexusCommandEventReader
An empty collection returned here indicates that this reader is valid in all Nexus blocks.
getValidBlocks
in interface NexusCommandEventReader
protected boolean isAllDataProcessed()
true
if the whole command this instance was created on has been parsed or false
if another events can be generated by the next call of readNextEvent()
.protected void setAllDataProcessed(boolean allDataProcessed)
protected NexusReaderStreamDataProvider getStreamDataProvider()
protected void consumeWhiteSpaceAndCommentsToBuffer(java.util.Collection<JPhyloIOEvent> buffer) throws java.io.IOException
java.io.IOException
protected abstract boolean doReadNextEvent() throws java.io.IOException
java.io.IOException
public boolean readNextEvent() throws java.io.IOException
NexusCommandEventReader
readNextEvent
in interface NexusCommandEventReader
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 itjava.io.IOException