[Biojava-l] [newio] Minor change to SequenceFormat.java

Thomas Down td2@sanger.ac.uk
Mon, 4 Dec 2000 18:07:47 +0000


I've changed the signature of SequenceFormat.readSequence
from:

  public void readSequence(StreamReader.Context ctx,
                           SymbolParser parser,
                           SeqIOListener listener);

to:

  public boolean readSequence(BufferedReader reader,
                              SymbolParser parser,
                              SeqIOListener listener);

This allows me to remove the (anachronistic) StreamReader.Context
class.  Previously, Context was used as a mechanism for the
readSequence method to notify StreamReader when the end of
the stream has been reached.  Now, the method simply returns
a boolean indicating if there are any more sequences expected.
StreamReader becomes correspondingly simpler.

This change should only affect people writing new SequenceFormats.
It's a 2-3 line change to update most SequenceFormat implementations
to the new interface.

I've also updated IndexedSequenceDB to work properly in the
newio world (this was another reason why I wanted to kill
StreamReader.Context).  It appears to be  working correctly
now, and the demos compile and run.  It would probably benefit
from some more thought and optimization before the 1.1 release,
though.


Happy hacking,

   Thomas.
-- 
``If I was going to carry a large axe on my back to a diplomatic
function I think I'd want it glittery too.''
           -- Terry Pratchett