|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines what a sequence format does.
Sequence formats are responsible for both reading and writing a sequence in a format, presumably in such a way as the written record can be read back in by the same formatter.
Where possible, the methods are parameterised so that they don't need any knowledge of the specific implementation of Sequence they are reading or writing. E.g. it should be possible to parameterise readSequence to read from a Genbank stream and construct Ensembl CORBA objects, just by specifying an Ensembl SequenceFactory.
Method Summary | |
java.lang.String |
getDefaultFormat()
Deprecated. new implementations should only write a single format. |
boolean |
readSequence(java.io.BufferedReader reader,
SymbolTokenization symParser,
SeqIOListener listener)
Read a sequence and pass data on to a SeqIOListener. |
void |
writeSequence(Sequence seq,
java.io.PrintStream os)
writeSequence writes a sequence to the specified
PrintStream, using the default format. |
void |
writeSequence(Sequence seq,
java.lang.String format,
java.io.PrintStream os)
Deprecated. use writeSequence(Sequence seq, PrintStream os) |
Method Detail |
public boolean readSequence(java.io.BufferedReader reader, SymbolTokenization symParser, SeqIOListener listener) throws BioException, IllegalSymbolException, java.io.IOException
reader
- The stream of data to parse.symParser
- A SymbolParser defining a mapping from
character data to Symbols.listener
- A listener to notify when data is extracted
from the stream.
java.io.IOException
- if an error occurs while reading from the
stream.
IllegalSymbolException
- if it is not possible to
translate character data from the stream into valid BioJava
symbols.
BioException
- if there is an error in the format of the
stream.public void writeSequence(Sequence seq, java.io.PrintStream os) throws java.io.IOException
writeSequence
writes a sequence to the specified
PrintStream, using the default format.
seq
- the sequence to write out.os
- the printstream to write to.
java.io.IOException
public void writeSequence(Sequence seq, java.lang.String format, java.io.PrintStream os) throws java.io.IOException
writeSequence
writes a sequence to the specified
PrintStream
, using the specified format.
seq
- a Sequence
to write out.format
- a String
indicating which sub-format
of those available from a particular
SequenceFormat
implemention to use when
writing.os
- a PrintStream
object.
java.io.IOException
- if an error occurs.public java.lang.String getDefaultFormat()
getDefaultFormat
returns the String identifier for
the default sub-format written by a SequenceFormat
implementation.
String
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |