public class FASTAFactory extends AbstractStartStringSingleFactory implements SingleReaderWriterFactory, JPhyloIOFormatIDs, FASTAConstants
The checkFormat()
methods test, if the content starts with FASTAConstants.NAME_START_CHAR
. They will
therefore return false
for empty files, which might anyway be FASTA files containing no sequences.
FASTA_FORMAT_ID, FORMAT_ID_PREFIX, MEGA_FORMAT_ID, NEWICK_FORMAT_ID, NEXML_FORMAT_ID, NEXUS_FORMAT_ID, PDE_FORMAT_ID, PHYLIP_FORMAT_ID, PHYLOXML_FORMAT_ID, SEQUENTIAL_PHYLIP_FORMAT_ID, XTG_FORMAT_ID
COMMENT_START_CHAR, DEFAULT_LINE_LENGTH, FASTA_FORMAT_NAME, NAME_START_CHAR
Constructor and Description |
---|
FASTAFactory() |
Modifier and Type | Method and Description |
---|---|
protected JPhyloIOFormatInfo |
createFormatInfo()
Returns the FASTA format info including a file filter that specifies the file extensions listed
here.
|
JPhyloIOEventReader |
getReader(java.io.InputStream stream,
ReadWriteParameterMap parameters)
Creates a new reader instance for the target format of this factory.
|
JPhyloIOEventReader |
getReader(java.io.Reader reader,
ReadWriteParameterMap parameters)
Creates a new reader instance for the target format of this factory.
|
JPhyloIOEventWriter |
getWriter()
Creates a new writer instance for the target format of this factory.
|
boolean |
hasReader()
Determines whether this factory is able to create reader instances for its target format.
|
boolean |
hasWriter()
Determines whether this factory is able to create writer instances for its target format.
|
checkFormat, getExpectedStart
checkFormat, getFormatInfo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkFormat, checkFormat, getFormatInfo
public FASTAFactory()
public JPhyloIOEventReader getReader(java.io.InputStream stream, ReadWriteParameterMap parameters) throws java.io.IOException
SingleReaderWriterFactory
getReader
in interface SingleReaderWriterFactory
stream
- the stream to provide the content for the readerparameters
- the parameter map for the new reader instancejava.io.IOException
public JPhyloIOEventReader getReader(java.io.Reader reader, ReadWriteParameterMap parameters) throws java.io.IOException
SingleReaderWriterFactory
getReader
in interface SingleReaderWriterFactory
parameters
- the parameter map for the new reader instancenull
if this factory is not able to create readersjava.io.IOException
SingleReaderWriterFactory.hasReader()
public JPhyloIOEventWriter getWriter()
SingleReaderWriterFactory
getWriter
in interface SingleReaderWriterFactory
null
if this factory is not able to create writersSingleReaderWriterFactory.hasWriter()
public boolean hasReader()
SingleReaderWriterFactory
hasReader
in interface SingleReaderWriterFactory
true
if creating readers is supported or false
otherwisepublic boolean hasWriter()
SingleReaderWriterFactory
hasWriter
in interface SingleReaderWriterFactory
true
if creating writers is supported or false
otherwiseprotected JPhyloIOFormatInfo createFormatInfo()
createFormatInfo
in class AbstractSingleReaderWriterFactory
SingleReaderWriterFactory.getFormatInfo()