public class NewickFactory extends AbstractSingleReaderWriterFactory implements SingleReaderWriterFactory, JPhyloIOFormatIDs, NewickConstants
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_IDALLOCATION_SEPARATOR_SYMBOL, ALLOCATION_SYMBOL, ALTERNATIVE_NAME_DELIMITER, COMMENT_END, COMMENT_START, DATA_TYPE_NEWICK_ARRAY, E_NEWICK_EDGE_TYPE_HYBRIDIZATION, E_NEWICK_EDGE_TYPE_LATERAL_GENE_TRANSFER, E_NEWICK_EDGE_TYPE_RECOMBINATION, E_NEWICK_NAMESPACE_PREFIX, E_NEWICK_NETWORK_DATA_SEPARATOR, ELEMENT_SEPERATOR, FIELD_END_SYMBOL, FIELD_START_SYMBOL, FIELD_VALUE_SEPARATOR_SYMBOL, FREE_NAME_BLANK, HOT_COMMENT_START_SYMBOL, INDEX_END_SYMBOL, INDEX_START_SYMBOL, LENGTH_SEPERATOR, NAME_DELIMITER, NEWICK_DATA_TYPE_NAMESPACE, NEWICK_FORMAT_NAME, NEWICK_NAMESPACE_PREFIX, NHX_KEY_CONFIDENCE, NHX_KEY_EVENT, NHX_KEY_GENE_NAME, NHX_KEY_PREFIX, NHX_KEY_SCIENTIFIC_NAME, NHX_KEY_SEQUENCE_ACCESSION, NHX_KEY_TAXONOMY_ID, NHX_START, NHX_VALUE_SEPARATOR_SYMBOL, PREDICATE_E_NEWICK_EDGE_TYPE, ROOTED_HOT_COMMENT, SUBTREE_END, SUBTREE_START, TERMINAL_SYMBOL, UNROOTED_HOT_COMMENT| Constructor and Description |
|---|
NewickFactory() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkFormat(java.io.Reader reader,
ReadWriteParameterMap parameters)
Since there is no real characteristic starting string for any Newick file, it is just checked whether at least five
events (if available) can be created from the input without an exception.
|
protected JPhyloIOFormatInfo |
createFormatInfo() |
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, getFormatInfoclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckFormat, getFormatInfopublic NewickFactory()
public boolean checkFormat(java.io.Reader reader, ReadWriteParameterMap parameters)
checkFormat in interface SingleReaderWriterFactoryreader - 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 formatSingleReaderWriterFactory.checkFormat(java.io.Reader, info.bioinfweb.jphyloio.ReadWriteParameterMap)public JPhyloIOEventReader getReader(java.io.InputStream stream, ReadWriteParameterMap parameters) throws java.io.IOException
SingleReaderWriterFactorygetReader in interface SingleReaderWriterFactorystream - the stream to provide the content for the readerparameters - the parameter map for the new reader instancejava.io.IOExceptionpublic JPhyloIOEventReader getReader(java.io.Reader reader, ReadWriteParameterMap parameters) throws java.io.IOException
SingleReaderWriterFactorygetReader in interface SingleReaderWriterFactoryparameters - the parameter map for the new reader instancenull if this factory is not able to create readersjava.io.IOExceptionSingleReaderWriterFactory.hasReader()public JPhyloIOEventWriter getWriter()
SingleReaderWriterFactorygetWriter in interface SingleReaderWriterFactorynull if this factory is not able to create writersSingleReaderWriterFactory.hasWriter()public boolean hasReader()
SingleReaderWriterFactoryhasReader in interface SingleReaderWriterFactorytrue if creating readers is supported or false otherwisepublic boolean hasWriter()
SingleReaderWriterFactoryhasWriter in interface SingleReaderWriterFactorytrue if creating writers is supported or false otherwiseprotected JPhyloIOFormatInfo createFormatInfo()
createFormatInfo in class AbstractSingleReaderWriterFactory