public class EventForwarder extends java.lang.Object
JPhyloIOEventReader and forwards them
to one or more JPhyloIOEventListeners.| Constructor and Description |
|---|
EventForwarder() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<JPhyloIOEventListener> |
getListeners()
Returns the list of listeners to which this instance forwards its consumed events.
|
void |
readAll(JPhyloIOEventReader reader)
Consumes all available events from the specified listener and forwards them to the registered listeners.
|
void |
readCurrentNode(JPhyloIOEventReader reader)
Consumes all events between a start and its respective end event.
|
void |
readUntil(JPhyloIOEventReader reader,
EventContentType type)
Consumes all available events from the specified listener and forwards them to the registered listeners
until an event of the specified type is reached.
|
void |
readUntil(JPhyloIOEventReader reader,
java.util.Set<EventContentType> types)
Consumes all available events from the specified listener and forwards them to the registered listeners
until any event of one of the specified types is reached.
|
public EventForwarder()
public java.util.List<JPhyloIOEventListener> getListeners()
public void readAll(JPhyloIOEventReader reader) throws java.io.IOException
reader - the reader to read the events fromjava.io.IOException - if reader throws an I/O exception while parsingpublic void readUntil(JPhyloIOEventReader reader, EventContentType type) throws java.io.IOException
reader - the reader to read the events fromtype - the type of the event that shall trigger the end of readingjava.io.IOException - if reader throws an I/O exception while parsingpublic void readUntil(JPhyloIOEventReader reader, java.util.Set<EventContentType> types) throws java.io.IOException
reader - the reader to read the events fromtypes - a set of types of the events that shall trigger the end of readingjava.io.IOException - if reader throws an exception while parsingpublic void readCurrentNode(JPhyloIOEventReader reader) throws java.io.IOException
reader - the reader to read the events fromjava.io.IOException - if reader throws an I/O exception while parsing