|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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 | |
Sequence |
readSequence(StreamReader.Context context,
SymbolParser resParser,
SequenceFactory sf)
Read in a single sequence. |
void |
writeSequence(Sequence seq,
java.io.PrintStream os)
Write out a sequence to the specified printstream |
Method Detail |
public Sequence readSequence(StreamReader.Context context, SymbolParser resParser, SequenceFactory sf) throws BioException, IllegalSymbolException, java.io.IOException
The format is responsible for converting characters in a stream into a
complete sequence. It should read from the stream contained in
context
, parse the symbol characters using
resParser
and generate a sequence from the resulting
symbol list using sf
. Any non-sequence information within
the format should be read in either as features, or as annotation.
context
- the context to parse fromresParser
- the parser to parse chars to Symbol objectssf
- the sequence factory for generating a full sequencepublic void writeSequence(Sequence seq, java.io.PrintStream os) throws java.io.IOException
seq
- the sequence to write outos
- the printstream to write to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |