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(java.lang.String formatName)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doWriteDocument(DocumentDataAdapter document,
java.io.Writer writer,
ReadWriteParameterMap parameters) |
protected java.lang.String |
editSequenceOrNodeLabel(LinkedLabeledIDEvent event,
ReadWriteParameterMap parameters,
OTUListDataAdapter otuList) |
protected abstract java.lang.String |
maskReservedLabelCharacters(java.lang.String label) |
protected abstract void |
writeSingleMatrix(DocumentDataAdapter document,
MatrixDataAdapter matrix,
java.util.Iterator<java.lang.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(java.lang.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, java.util.Iterator<java.lang.String> sequenceIDIterator, ReadWriteParameterMap parameters) throws java.io.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 implementationjava.lang.Exception
- if the implementing writer throws an exceptionjava.io.IOException
protected java.lang.String editSequenceOrNodeLabel(LinkedLabeledIDEvent event, ReadWriteParameterMap parameters, OTUListDataAdapter otuList)
protected abstract java.lang.String maskReservedLabelCharacters(java.lang.String label)
protected void doWriteDocument(DocumentDataAdapter document, java.io.Writer writer, ReadWriteParameterMap parameters) throws java.io.IOException
doWriteDocument
in class AbstractTextEventWriter<P extends TextWriterStreamDataProvider<? extends AbstractTextEventWriter<P>>>
java.io.IOException