public abstract class AbstractPhylipFactory extends AbstractSingleReaderWriterFactory implements SingleReaderWriterFactory, PhylipConstants, JPhyloIOFormatIDs
Modifier and Type | Field and Description |
---|---|
static int |
MAXIMUM_EXPECTED_DIGITS_OR_WHITESPACE
Defines the maximum number of digits in a column or line count definition of a Phylip file.
|
DEFAULT_NAME_LENGTH, PHYLIP_FORMAT_NAME, PREMATURE_NAME_END_CHARACTER, RELAXED_PHYLIP_NAME_PATTERN, SEQUENTIAL_PHYLIP_FORMAT_NAME
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
Constructor and Description |
---|
AbstractPhylipFactory() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkFormat(java.io.Reader reader,
ReadWriteParameterMap parameters)
Implementations should read the start of the characters returned by the reader here and determine whether
the content could be valid according to the target format.
|
protected JPhyloIOFormatInfo |
createFormatInfo(java.lang.String formatID,
java.lang.String formatName,
java.util.Set<java.lang.String> supportedReaderParameters,
java.util.Set<java.lang.String> supportedWriterParameters,
java.lang.String adapterDescription) |
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, createFormatInfo, getFormatInfo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkFormat, getFormatInfo, getReader, getReader
public static final int MAXIMUM_EXPECTED_DIGITS_OR_WHITESPACE
checkFormat()
.public AbstractPhylipFactory()
public boolean checkFormat(java.io.Reader reader, ReadWriteParameterMap parameters) throws java.io.IOException
SingleReaderWriterFactory
checkFormat
in interface SingleReaderWriterFactory
reader
- the reader to read the first bytes fromparameters
- the parameters map that would also be used to create a readertrue
if the tested reader may return content in target format or false
if the content is not
in valid target formatjava.io.IOException
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(java.lang.String formatID, java.lang.String formatName, java.util.Set<java.lang.String> supportedReaderParameters, java.util.Set<java.lang.String> supportedWriterParameters, java.lang.String adapterDescription)