public abstract class AbstractSingleMatrixEventWriter<P extends TextWriterStreamDataProvider<? extends AbstractTextEventWriter<P>>> extends AbstractTextEventWriter<P>
This abstract implementation will log according warnings for the other data that has not been written and than
calls #writeSingleMatrix(DocumentDataAdapter, MatrixDataAdapter, Iterator, Writer, ReadWriteParameterMap)
which must be implemented by inherited classes accordingly.
AbstractEventWriter.NoEditUniqueLabelHandler, AbstractEventWriter.UniqueLabelHandler
EDITED_LABEL_SEPARATOR
Constructor and Description |
---|
AbstractSingleMatrixEventWriter(String formatName)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doWriteDocument(DocumentDataAdapter document,
Writer writer,
ReadWriteParameterMap parameters) |
protected String |
editSequenceOrNodeLabel(LinkedLabeledIDEvent event,
ReadWriteParameterMap parameters,
OTUListDataAdapter otuList) |
protected abstract String |
maskReservedLabelCharacters(String label) |
protected abstract void |
writeSingleMatrix(DocumentDataAdapter document,
MatrixDataAdapter matrix,
Iterator<String> sequenceIDIterator,
ReadWriteParameterMap parameters)
Implementations of this method should write a single matrix to their target format.
|
getWriter
createStreamDataProvider, createUniqueLabel, createUniqueLabel, createUniqueLabel, createUniqueLinkedOTULabel, decreaseIndention, determineMaxSequenceLength, extendSequence, getFileStartInfo, getIndention, getLabeledIDName, getLinkedOTUNameOTUFirst, getLinkedOTUNameOwnFirst, getReferencedOTUList, getStreamDataProvider, increaseIndention, logIngnoredOTULists, writeDocument, writeDocument, writeDocument, writeLineBreak, writeLineStart
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFormatID
public AbstractSingleMatrixEventWriter(String formatName)
formatName
- the name of the format the inherited implementation writes to, which will be used for the log
messages generated by this abstract implementation.protected abstract void writeSingleMatrix(DocumentDataAdapter document, MatrixDataAdapter matrix, Iterator<String> sequenceIDIterator, ReadWriteParameterMap parameters) throws IOException
document
- the document containing the matrixmatrix
- the (non-empty) matrix to be writtensequenceIDIterator
- an iterator oder all sequences in matrix
positioned before the first sequencewriter
- the writer to write the data toparameters
- the parameter map for the writer implementationException
- if the implementing writer throws an exceptionIOException
protected String editSequenceOrNodeLabel(LinkedLabeledIDEvent event, ReadWriteParameterMap parameters, OTUListDataAdapter otuList)
protected abstract String maskReservedLabelCharacters(String label)
protected void doWriteDocument(DocumentDataAdapter document, Writer writer, ReadWriteParameterMap parameters) throws IOException
doWriteDocument
in class AbstractTextEventWriter<P extends TextWriterStreamDataProvider<? extends AbstractTextEventWriter<P>>>
IOException