public interface JPhyloIOEventReceiver
Modifier and Type | Method and Description |
---|---|
boolean |
add(JPhyloIOEvent event)
Adds a new event to the sequence written to this receiver.
|
boolean add(JPhyloIOEvent event) throws java.io.IOException
Note that this acceptor indicates whether writing events shall be aborted by its return value.
This maybe the case, if the writer providing this acceptor was seeking for a specific piece of
information and is (currently) not interested in the remaining events. Data adapter implemented
by applications should consider the return value to allow saving runtime. If event writing goes
on after false
was returned, subsequent events will be ignored but no exception will be
thrown.
Conversely, a return value of true
does not necessarily mean that more events are expected
in order to complete the expected information.
Exceptions thrown by this instance should not be caught within any of the write*()
methods
in application implementations of any data adapter (e.g.
MatrixDataAdapter.writeSequencePartContentData(ReadWriteParameterMap, JPhyloIOEventReceiver, String, long, long)
.
They will be forwarded by the calling writer and can be handled by the application when
JPhyloIOEventWriter.writeDocument(DocumentDataAdapter, Writer, ReadWriteParameterMap)
(or one of the other overloaded versions) are called.
event
- the event to be addtrue
if more events can be written to this acceptor or false
if writing should
be abortedIllegalEventException
- if the specified event is illegal in this acceptor in general or at
the current position in the sequencejava.lang.ClassCastException
- if an event object was specified that is not an instance of a class associated
with its type as document in EventContentType
java.io.IOException
- if an I/O error occurs when writing to the underlying stream